Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for packaging KEVM on Arch/Ubuntu #614

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6fa6501
PKGBUILD: recursively update submodules before building
ehildenb Jul 9, 2019
6a7e43c
PKGBUILD: correct makedepends
ehildenb Jul 9, 2019
2f7f8eb
.gitignore, PKGBUILD: more self contained Arch packaging
ehildenb Jul 10, 2019
9aae93b
PKGBUILD: tabs => spaces
ehildenb Jul 10, 2019
b1383dc
PKGBUILD: setup CARGO_HOME and RUSTUP_HOME
ehildenb Jul 10, 2019
6cab160
.gitignore: ignore files generated during packaging
ehildenb Jul 10, 2019
2c6c3c1
PKGBUILD: add fakeroot makedepends
ehildenb Jul 10, 2019
a575bfc
PKGBUILD: use git source based install
ehildenb Jul 11, 2019
1e12e0e
PKGBUILD, kframework-git.install: suffix with -git as VCS guide says
ehildenb Jul 11, 2019
e500308
PKGBUILD: organize
ehildenb Jul 15, 2019
b554f22
debian/control: add pkg-config for building
ehildenb Jul 15, 2019
4a74eef
debian/rules: local CARGO_HOME and RUSTUP_HOME
ehildenb Jul 16, 2019
bc370ee
INSTALL.md: add packaging documentation
ehildenb Jul 16, 2019
c4d4eba
debian/control: add llvm-8-tools to Build-Depends
ehildenb Jul 16, 2019
b662aee
PKGBUILD: user `master` branch for making package
ehildenb Jul 16, 2019
43bdd3a
PKGBUILD: do not do local CARGO/RUSTUP installs
ehildenb Jul 16, 2019
576a65a
debian/rules: do not do local install of CARGO/RUSTUP
ehildenb Jul 16, 2019
78adf89
debian/control: add haskell-stack dependency
ehildenb Jul 16, 2019
b6021a5
INSTALL: add installation instructions
ehildenb Jul 16, 2019
587815f
debian/rules: correct default CARGO_HOME
ehildenb Jul 17, 2019
39cd575
Dockerfile.debian: install haskell-stack and forcibly update it
ehildenb Jul 18, 2019
3f942e4
INSTALL: update instructions slightly
ehildenb Jul 18, 2019
867f379
debian/rules: try without setting any environment up
ehildenb Jul 18, 2019
9d54f11
debian/rules: KEVM build doesnt work without CARGO_HOME set
ehildenb Jul 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ junit-reports
target/
kore/doc
__pycache__
rustc-*-src
/rustc-*
/.cargo
/.rustup
/pkg
4 changes: 2 additions & 2 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ARG BASE_IMAGE

RUN if [ "$BASE_IMAGE" = "debian:stretch" ]; then echo "Enabling backports..."; echo "deb http://ftp.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/stretch-backports.list; fi
RUN apt-get update && \
apt-get install -y git debhelper maven openjdk-8-jdk cmake libboost-test-dev libyaml-dev libjemalloc-dev flex bison clang-8 llvm-8-tools lld-8 zlib1g-dev libgmp-dev libmpfr-dev gcc z3 libz3-dev opam pkg-config curl python3
apt-get install -y git debhelper maven openjdk-8-jdk cmake libboost-test-dev libyaml-dev libjemalloc-dev flex bison clang-8 llvm-8-tools lld-8 zlib1g-dev libgmp-dev libmpfr-dev gcc z3 libz3-dev opam pkg-config curl python3 haskell-stack
RUN update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
RUN curl -sSL https://get.haskellstack.org/ | sh
RUN curl -sSL https://get.haskellstack.org/ | sh -s - -f

ARG USER_ID=1000
ARG GROUP_ID=1000
Expand Down
78 changes: 78 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Installing Release Builds
=========================

These instructions explain how to download, install, and build the K packages.
Current supported systems are:

- Arch Linux
- Ubuntu Bionic (18.04)
- Ubuntu Xenial (16.04)
- Debian Stretch

Downloading Packages
--------------------

We release our packages on GitHub, visit the [Releases](https://github.com/kframework/k/releases) page to see available versions.
Releases are generated as often as possible from the `master` branch of the repository.

Installing Packages
-------------------

### Ubuntu/Debian

Install the package with (`X.Y.Z` is version number, `ID` is platform identifier):

```sh
sudo apt install ./kframework_X.Y.Z_amd64_ID.deb
```

On Debian Stretch, you also must first enable stretch-backports by running:

```sh
sudo echo "deb http://ftp.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/stretch-backports.list
sudo apt-get update.
```

### Arch

Install the package with (`X.Y.Z-V` is version number):

```sh
sudo pacman -U ./kframework-git-X.Y.Z-V-x86_64.pkg.tar.xz
```

### Windows

On Windows, start by installing Windows Subsystem for Linux with Ubuntu (or an Ubuntu VM), after which you can install like Ubuntu.
K requires gcc and other Linux libraries to run, and building on native Windows, Cygwin, or MINGW is not supported

### Other

If your OS is not supported, you can download and extract the "Platform-Independent K binary", and follow the instructions in INSTALL.md within the target directory.
Note however that this will not support the Haskell or LLVM Backends.

Building Packages
-----------------

Update `stack` with `sudo stack upgrade` or `curl -sSL https://get.haskellstack.org/ | sh -s - -f` to make sure you have the newest version (> 2.0).

### Ubuntu/Debian

Build the package in by running:

```sh
dpkg-buildpackage --no-sign
```

This will throw an error for any build dependencies you're missing, install them with `sudo apt install ...`.
The `kframework_X.Y.Z_amd64_ID.deb` package will be placed one directory up from the repository root.

### Arch

Build the package with:

```sh
makepkg -s
```

This will put `kframework-git-X.Y.Z-V-x86_64.pkg.tar.xz` in the current directory.
33 changes: 16 additions & 17 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
# Maintainer: Dwight Guth <dwight.guth@runtimeverification.com>
pkgname=kframework
pkgname=kframework-git
pkgver=5.0.0
pkgrel=1
epoch=
pkgdesc="K framework toolchain. Includes K Framework compiler for K language definitions, and K interpreter and prover for programs written in languages defined in K."
pkgdesc='K framework toolchain. Includes K Framework compiler for K language definitions, and K interpreter and prover for programs written in languages defined in K.'
arch=('x86_64')
url="https://github.com/kframework/k"
url='https://github.com/kframework/k'
license=('custom')
groups=()
depends=('java-runtime' 'flex' 'gcc' 'gmp' 'mpfr' 'z3' 'clang' 'libyaml' 'jemalloc' 'opam' 'gawk' 'make' 'diffutils' 'patch' 'tar' 'grep' 'llvm' 'lld')
makedepends=('maven' 'jdk-openjdk' 'cmake' 'boost' 'zlib')
makedepends=('maven' 'jdk8-openjdk' 'cmake' 'boost' 'zlib' 'stack' 'pkg-config' 'bison' 'python' 'fakeroot')
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=(!strip)
install=kframework.install
install=kframework-git.install
changelog=
source=()
source=('git+https://github.com/kframework/k#branch=master')
noextract=()
md5sums=()
md5sums=('SKIP')
validpgpkeys=()

prepare() {
true
cd "$srcdir/k"
git submodule update --init --recursive
./llvm-backend/src/main/native/llvm-backend/install-rust
}

build() {
cd ..
mvn package -DskipTests
}

check() {
true
export PATH="${CARGO_HOME:-$HOME/.cargo}/bin:$PATH"
cd "$srcdir/k"
mvn package -DskipTests
}

package() {
cd ..
DESTDIR="$pkgdir/usr/" src/main/scripts/package
install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
cd "$srcdir/k"
DESTDIR="$pkgdir/usr/" src/main/scripts/package
install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: kframework
Section: devel
Priority: optional
Maintainer: Dwight Guth <dwight.guth@runtimeverification.com>
Build-Depends: debhelper (>=9), maven, openjdk-8-jdk, cmake, libboost-test-dev, libyaml-dev, libjemalloc-dev, flex, bison, clang-8, zlib1g-dev, libgmp-dev, libmpfr-dev
Build-Depends: debhelper (>=9), maven, openjdk-8-jdk, cmake, libboost-test-dev, libyaml-dev, libjemalloc-dev, flex, bison, clang-8, zlib1g-dev, libgmp-dev, libmpfr-dev, pkg-config, llvm-8-tools, haskell-stack
Standards-Version: 3.9.6
Homepage: https://github.com/kframework/k

Expand Down
6 changes: 5 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

CARGO_HOME?=$(HOME)/.cargo
export CARGO_HOME

%:
dh $@
dh $@

override_dh_auto_build:
git submodule update --init --recursive
./llvm-backend/src/main/native/llvm-backend/install-rust
mvn package -DskipTests

override_dh_auto_install:
Expand Down
File renamed without changes.