Skip to content

Commit

Permalink
Meta: Get building on NixOS (SerenityOS#5005)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Turner committed Jan 22, 2021
1 parent 2fe6a31 commit 0bf5669
Show file tree
Hide file tree
Showing 82 changed files with 119 additions and 82 deletions.
38 changes: 38 additions & 0 deletions Documentation/BuildInstructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,44 @@ sudo apt update

Ensure your CMake version is >= 3.16 with `cmake --version`. If your system doesn't provide a suitable version of CMake, you can download a binary release from the [CMake website](https://cmake.org/download).

**NixOS**

You can use a `nix-shell` script like the following to set up the correct environment:

myshell.nix:
```
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "cpp-env";
nativeBuildInputs = [
gcc10
curl
cmake
mpfr
ninja
gmp
libmpc
e2fsprogs
patch
# Example Build-time Additional Dependencies
pkgconfig
];
buildInputs = [
# Example Run-time Additional Dependencies
openssl
x11
# glibc
];
hardeningDisable = [ "format" "fortify" ];
}
```

Then use this script: `nix-shell myshell.nix`.

Once you're in nix-shell, you should be able to follow the build directions.

#### macOS prerequisites
Make sure you have all the dependencies installed:
```bash
Expand Down
2 changes: 1 addition & 1 deletion Meta/check-ak-test-files.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eo pipefail

Expand Down
2 changes: 1 addition & 1 deletion Meta/check-debug-flags.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eo pipefail

Expand Down
2 changes: 1 addition & 1 deletion Meta/check-style.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cd "$script_path/.." || exit 1
Expand Down
2 changes: 1 addition & 1 deletion Meta/generate-embedded-resource-assembly.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion Meta/lint-ci.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion Meta/lint-clang-format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion Meta/lint-executable-resources.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eo pipefail

Expand Down
2 changes: 1 addition & 1 deletion Meta/lint-ipc-ids.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eo pipefail

Expand Down
2 changes: 1 addition & 1 deletion Meta/lint-missing-resources.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eo pipefail

Expand Down
2 changes: 1 addition & 1 deletion Meta/lint-prettier.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion Meta/lint-python.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion Meta/lint-shell-scripts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eo pipefail

Expand Down
2 changes: 1 addition & 1 deletion Ports/.port_include.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu

SCRIPT=`dirname $0`
Expand Down
2 changes: 1 addition & 1 deletion Ports/SDL2/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=SDL2
version=serenity-git
workdir=SDL-master-serenity
Expand Down
2 changes: 1 addition & 1 deletion Ports/bash/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=bash
version=5.0
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/bc/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=bc
version=2.5.1
files="https://github.com/gavinhoward/bc/releases/download/${version}/bc-${version}.tar.xz bc-${version}.tar.xz
Expand Down
2 changes: 1 addition & 1 deletion Ports/binutils/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=binutils
version=2.32
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/build_all.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

clean=false
case "$1" in
Expand Down
2 changes: 1 addition & 1 deletion Ports/byacc/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=byacc
version=20191125
files="https://invisible-mirror.net/archives/byacc/byacc-${version}.tgz byacc-${version}.tgz
Expand Down
2 changes: 1 addition & 1 deletion Ports/c-ray/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=c-ray
version=git
workdir=c-ray-master
Expand Down
2 changes: 1 addition & 1 deletion Ports/curl/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=curl
version=7.65.3
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/dash/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=dash
version=0.5.10.2
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/diffutils/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=diffutils
version=3.5
files="https://ftp.gnu.org/gnu/diffutils/diffutils-${version}.tar.xz diffutils-${version}.tar.xz
Expand Down
2 changes: 1 addition & 1 deletion Ports/doom/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=doom
workdir=SerenityDOOM-master
version=serenity-git
Expand Down
2 changes: 1 addition & 1 deletion Ports/dropbear/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=dropbear
version=2019.78
files="https://mirror.dropbear.nl/mirror/releases/dropbear-${version}.tar.bz2 dropbear-${version}.tar.bz2
Expand Down
2 changes: 1 addition & 1 deletion Ports/ed/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=ed
version=1.15
files="https://ftp.gnu.org/gnu/ed/ed-1.15.tar.lz ed-1.15.tar.lz"
Expand Down
2 changes: 1 addition & 1 deletion Ports/editline/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=editline
version=1.17.1
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/figlet/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=figlet
version=2.2.5
files="http:https://ftp.figlet.org/pub/figlet/program/unix/figlet-2.2.5.tar.gz figlet-2.2.5.tar.gz d88cb33a14f1469fff975d021ae2858e"
Expand Down
2 changes: 1 addition & 1 deletion Ports/flex/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=flex
version=2.6.4
files="https://github.com/westes/flex/releases/download/v${version}/flex-${version}.tar.gz flex-${version}.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion Ports/frotz/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=frotz
version=git
workdir=frotz-master
Expand Down
2 changes: 1 addition & 1 deletion Ports/gcc/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=gcc
version=10.2.0
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/git/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=git
version=2.26.0
useconfigure="true"
Expand Down
2 changes: 1 addition & 1 deletion Ports/gnuplot/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=gnuplot
version=5.2.8
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/grep/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=grep
version=2.5.4
files="https://ftp.gnu.org/gnu/grep/grep-${version}.tar.gz grep-${version}.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion Ports/indent/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=indent
version=2.2.11
files="https://ftp.gnu.org/gnu/indent/indent-${version}.tar.gz indent-${version}.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion Ports/jot/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=jot
version=6.6
files="https://github.com/ibara/libpuffy/releases/download/libpuffy-1.0/jot-${version}.tar.gz jot-${version}.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion Ports/jq/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=jq
version=1.6
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/klong/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=klong
version=20190926
files="http:https://t3x.org/klong/klong20190926.tgz klong20190926.tgz"
Expand Down
2 changes: 1 addition & 1 deletion Ports/less/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=less
version=530
useconfigure="true"
Expand Down
2 changes: 1 addition & 1 deletion Ports/libarchive/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=libarchive
version=3.4.0
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/libexpat/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=libexpat
version=2.2.9
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/libffi/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=libffi
version=3.3
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/libiconv/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=libiconv
version=1.16
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/libpuffy/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=libpuffy
version=1.0
files="https://github.com/ibara/libpuffy/releases/download/libpuffy-${version}/libpuffy-${version}.tar.gz libpuffy-${version}.tar.gz"
2 changes: 1 addition & 1 deletion Ports/links/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=links
version=2.19
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/lua/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=lua
version=5.3.5
files="http:https://www.lua.org/ftp/lua-5.3.5.tar.gz lua-5.3.5.tar.gz 4f4b4f323fd3514a68e0ab3da8ce3455"
Expand Down
2 changes: 1 addition & 1 deletion Ports/m4/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=m4
version=1.4.9
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/make/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=make
version=4.3
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/mandoc/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=mandoc
version=1.14.5
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/mawk/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=mawk
version=1.3.4-20200120
files="https://invisible-mirror.net/archives/mawk/mawk-${version}.tgz mawk-${version}.tgz
Expand Down
2 changes: 1 addition & 1 deletion Ports/mbedtls/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=mbedtls
version=2.16.2
files="https://tls.mbed.org/download/mbedtls-${version}-apache.tgz mbedtls-${version}-apache.tgz ba809acfd4b41b86895b92e98d936695b5b62b73"
Expand Down
2 changes: 1 addition & 1 deletion Ports/mrsh/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=mrsh
version=d9763a32e7da572677d1681bb1fc67f117d641f3
files="https://codeload.github.com/emersion/mrsh/legacy.tar.gz/d9763a32e7da572677d1681bb1fc67f117d641f3 emersion-mrsh-d9763a3.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion Ports/nano/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=nano
version=4.5
useconfigure="true"
Expand Down
2 changes: 1 addition & 1 deletion Ports/nasm/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=nasm
version=2.14.02
files="https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz nasm-2.14.02.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion Ports/ncurses/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=ncurses
version=6.2
useconfigure=true
Expand Down
2 changes: 1 addition & 1 deletion Ports/neofetch/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=neofetch
version=7.0.0
useconfigure=false
Expand Down
2 changes: 1 addition & 1 deletion Ports/neofetch/patches/fix-shebang.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
+++ neofetch-7.0.0/neofetch 2020-04-27 18:57:54.263417418 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/bash
+#!/usr/bin/env bash
# vim: noai:ts=4:sw=4:expandtab
# shellcheck source=/dev/null
# shellcheck disable=2009
2 changes: 1 addition & 1 deletion Ports/nesalizer/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash ../.port_include.sh
#!/usr/bin/env -S bash ../.port_include.sh
port=nesalizer
version=master
makeopts="CONF=release"
Expand Down
Loading

0 comments on commit 0bf5669

Please sign in to comment.