Skip to content
Snippets Groups Projects
Commit 6824e451 authored by Michael Aaron Murphy's avatar Michael Aaron Murphy
Browse files

Fix debian packaging, and mention new PPA

parent 71434897
No related branches found
No related tags found
No related merge requests found
!.travis
cachegrind.*
perf.*
git_revision.txt
target
manual/book
.cargo/config
......
......@@ -3,31 +3,32 @@ BINARY = $(prefix)/bin/ion
RELEASE = debug
DEBUG ?= 0
VENDORED = 0
REDOX ?= 0
ifeq (0,$(DEBUG))
ARGS += --release
RELEASE = release
endif
ifeq (1,$(REDOX))
ARGS += --target x86_64-unknown-redox
endif
ifneq ($(wildcard vendor.tar.xz),)
VENDORED = 1
ARGSV += --frozen
endif
ifeq (1,$(REDOX))
undefine ARGSV
ARGS += --target x86_64-unknown-redox
endif
.PHONY: all clean distclean install uninstall
all: extract .cargo/config
all: version extract .cargo/config
cargo build $(ARGS) $(ARGSV)
clean:
cargo clean
distclean:
rm -rf vendor vendor.tar.xz .cargo
distclean: clean
rm -rf vendor vendor.tar.xz .cargo git_revision.txt
tests:
cargo test $(ARGSV)
......@@ -44,23 +45,31 @@ uninstall:
.cargo/config:
mkdir -p .cargo
if [ -f vendor.tar.xz ]; then \
echo $(wildcard vendor.tar.xz)
if [ "$(wildcard vendor.tar.xz)" != "" ]; then \
cp vendor_config $@; \
else \
cp nonvendor_config $@; \
fi \
fi
vendor.tar.xz:
cargo vendor
tar pcfJ vendor.tar.xz vendor
rm -rf vendor
vendor: .cargo/config vendor.tar.xz
vendor: vendor.tar.xz .cargo/config
extract:
ifeq (1,$(VENDORED)$(wildcard vendor))
ifneq ($(wildcard vendor.tar.xz),)
ifneq (1,$(REDOX))
tar pxf vendor.tar.xz
endif
endif
version:
ifeq ($(wildcard git_revision.txt),)
git rev-parse master > git_revision.txt
endif
update-shells:
if ! grep ion /etc/shells >/dev/null; then \
......@@ -71,3 +80,4 @@ update-shells:
sed -i -e "s#$$shell#$(BINARY)#g" /etc/shells; \
fi \
fi
......@@ -28,6 +28,16 @@ The manual is located [here](https://doc.redox-os.org/ion-manual/) on Redox OS's
also included in the source code for Ion, within the **manual** directory, which you may build
with **mdbook**.
# Packages
## Pop!\_OS / Ubuntu
The following PPA supports the 18.04 (bionic) and 18.10 (cosmic) releases. Bionic builds were made using the Pop\_OS PPA's rustc 1.28.0 package.
```
sudo add-apt-repository ppa:mmstick76/ion-shell
```
# Build dependencies
Those who are developing software with Rust should install the [Rustup toolchain manager](https://rustup.rs/).
......
......@@ -5,7 +5,7 @@
use std::{
env,
fs::File,
fs::{self, File},
io::{self, Read, Write},
path::Path,
process::Command,
......@@ -34,14 +34,19 @@ fn write_version_file() -> io::Result<()> {
}
fn get_git_rev() -> io::Result<String> {
let rev = match Command::new("git").arg("rev-parse").arg("master").output() {
Ok(out) => match String::from_utf8(out.stdout) {
Ok(s) => s,
Err(_) => git_rev_from_file()?,
},
Err(_) => git_rev_from_file()?,
};
Ok(rev)
let version_file = Path::new("git_revision.txt");
if version_file.exists() {
fs::read_to_string(&version_file)
} else {
Command::new("git").arg("rev-parse").arg("master").output()
.and_then(|out| {
String::from_utf8(out.stdout).map_err(|_| io::Error::new(
io::ErrorKind::InvalidData,
format!("git rev-parse master output was not UTF-8")
))
})
.or_else(|_| git_rev_from_file())
}
}
fn git_rev_from_file() -> io::Result<String> {
......
ion-shell (1.0.0~alpha0) cosmic; urgency=medium
ion-shell (1.0.0-alpha0-cosmic2) cosmic; urgency=medium
* Initial release
* Add postinst script for setting the shell.
-- Michael Aaron Murphy <michael@system76.com> Thu, 01 Nov 2018 16:44:15 -0600
-- Michael Aaron Murphy <michael@system76.com> Sat, 20 Oct 2018 12:12:12 -0600
ion-shell-dbgsym_1.0.0~alpha0_amd64.ddeb debug optional
ion-shell_1.0.0~alpha0_amd64.buildinfo admin optional
ion-shell_1.0.0~alpha0_amd64.deb admin optional
#!/bin/sh
BINARY="/usr/bin/ion"
if ! grep ion /etc/shells >/dev/null; then
echo ${BINARY} >> /etc/shells
else
shell=$(grep ion /etc/shells)
if [ "$shell" != "${BINARY}" ]; then
sed -i -e "s#$shell#${BINARY}#g" /etc/shells
fi
fi
#!/bin/sh
if ! grep ion /etc/shells >/dev/null; then
echo $(BINARY) >> /etc/shells;
else
shell=$(shell grep ion /etc/shells);
if [ $$shell != $(BINARY) ]; then
before=$$(echo $$shell | sed 's/\//\\\//g');
after=$$(echo $(BINARY) | sed 's/\//\\\//g');
sed -i -e "s/$$before/$$after/g" /etc/shells;
fi
fi
......@@ -4,8 +4,14 @@
dh $@
override_dh_auto_clean:
cat git_revision.txt || echo git_revision.txt not found
make clean
make vendor
make version
override_dh_auto_build:
cat .cargo/config
make all
override_dh_auto_install:
dh_auto_install -- prefix=/usr
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment