diff --git a/ci.nix b/ci.nix new file mode 100644 index 0000000000..9e03a56a77 --- /dev/null +++ b/ci.nix @@ -0,0 +1,123 @@ +/* Examples + + Perform the same evaluation that occurs on CI via: + + $ NIX_PATH="" nix-instantiate ci.nix --arg supportedSystems '["x86_64-darwin"]' + + Build the release tarball: + + $ NIX_PATH="" nix-instantiate ci.nix -A darwin.tarball +*/ + +{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ] }: + +let + + inherit (import ./nix/default.nix { }) + lib recurseIntoAttrs haskell-nix callPackage; + + # Local library import from derivation functions such as fetchGitHubLFS, etc. + # upon which local package defintions are dependent. + localLib = callPackage ./nix/lib { }; + + # The key with google storage bucket write permission, + # deployed to ci via nixops `deployment.keys."service-account.json"`. + serviceAccountKey = builtins.readFile ("/var/run/keys/service-account.json"); + + # Push a split output derivation containing "out" and "hash" outputs. + pushObject = name: extension: drv: + let + # Use the sha256 for the object key suffix. + sha256 = builtins.readFile (drv.hash + "/sha256"); + # Use md5 as an idempotency check for gsutil + md5 = builtins.readFile (drv.hash + "/md5"); + in localLib.pushStorageObject { + inherit serviceAccountKey md5; + + bucket = "bootstrap.urbit.org"; + object = "ci/${name}-${sha256}.${extension}"; + name = "${name}.${extension}"; + file = drv.out; + }; + + # Push a split output pill derivation containing "build" attribute with the + # with the ".pill" file extension. + pushPill = name: drv: pushObject name "pill" drv.build; + + systems = lib.filterAttrs (_: v: builtins.elem v.system supportedSystems) { + linux = { + system = "x86_64-linux"; + crossSystem = lib.systems.examples.musl64; + }; + + darwin = { + system = "x86_64-darwin"; + crossSystem = null; + }; + }; + +in localLib.dimension "system" systems (systemName: + { system, crossSystem }: + let + # Check the pinned haskell.nix hashes for correctness. + checkMaterialization = true; + + # Shared libraries/executables for the build (current) system. + localPackages = import ./default.nix { + inherit system checkMaterialization; + + enableStatic = false; + }; + + # Static libraries/executables for the host (cross) system. + staticPackages = import ./default.nix { + inherit system crossSystem checkMaterialization; + + enableStatic = true; + }; + + # Filter the stack project to only our locally declared packages. + haskellPackages = + haskell-nix.haskellLib.selectProjectPackages staticPackages.hs; + + # The top-level set of attributes to build on ci. + finalPackages = localPackages // { + # Expose the nix-shell derivation as a sanity check. + shell = import ./shell.nix; + + # Replace the top-level urbit attribute with the static variant. + urbit = staticPackages.urbit; + + # Replace the top-level tarball attribute with the static variant. + tarball = staticPackages.tarball; + + # Replace the localPackages.hs attribute with the individual components + # displayed as top-level attributes: + # + # .hs.library.[...] + # .hs.tests.[...] + # .hs.bencharmks.[...] + # ... + hs = localLib.collectHaskellComponents haskellPackages; + + # Push the tarball to the remote google storage bucket. + release = let + version = builtins.readFile ./pkg/urbit/version; + name = "urbit-v${version}-${system}"; + in pushObject name "tar.gz" staticPackages.tarball; + + # Replace top-level pill attributes with push to google storage variants. + } // lib.optionalAttrs (system == "x86_64-linux") { + ivory = pushPill "ivory" localPackages.ivory; + brass = pushPill "brass" localPackages.brass; + solid = pushPill "solid" localPackages.solid; + + ivory-ropsten = pushPill "ivory-ropsten" localPackages.ivory-ropsten; + brass-ropsten = pushPill "brass-ropsten" localPackages.brass-ropsten; + }; + + # Filter derivations that have meta.platform missing the current system, + # such as testFakeShip on darwin. + platformFilter = localLib.platformFilterGeneric system; + + in localLib.filterAttrsOnlyRecursive (_: v: platformFilter v) finalPackages) diff --git a/default.nix b/default.nix index a21725f733..b1782a173b 100644 --- a/default.nix +++ b/default.nix @@ -1,8 +1,164 @@ +/* Examples + + Shared urbit and urbit-worker binaries: + + $ nix-build -A urbit + + Static urbit and urbit-worker binaries: + + $ nix-build -A urbit --arg enableSatic true + + Static urbit-king binary: + + $ nix-build -A hs.urbit-king.components.exes.urbit-king --arg enableStatic true + + Static release tarball: + + $ nix-build -A tarball --arg enableStatic true + + Build a pill: + + $ nix-build -A ivory.build + $ nix-build -A brass.build + $ nix-build -A solid.build + + Build a specific Haskell package from ./pkg/hs: + + $ nix-build -A hs.urbit-noun.components.library + $ nix-build -A hs.urbit-atom.components.benchmarks.urbit-atom-bench + $ nix-build -A hs.urbit-atom.components.tests.urbit-atom-tests +*/ + +# The build system where packages will be _built_. +{ system ? builtins.currentSystem + # The host system where packages will _run_. +, crossSystem ? null + # Additional sources.json overrides. +, sources ? { } + # Additional nixpkgs.config overrides. +, config ? { } + # Additional nixpkgs.overlays. +, overlays ? [ ] + # Overlays to apply to the last package set in cross compilation. +, crossOverlays ? [ ] + # Whether to use pkgs.pkgsStatic.* to obtain statically linked package + # dependencies - ie. when building fully-static libraries or executables. +, enableStatic ? crossSystem != null + # Whether to check that the pinned hashes for haskell.nix are correct. + # Set to false by default since it's a lot slower, but true for ci. +, checkMaterialization ? false }: + let - pkgs = import ./nix/pkgs {}; - deps = import ./nix/deps {}; + pkgs = import ./nix/default.nix { + inherit system crossSystem sources config overlays crossOverlays; + }; -in + # Local library import from derivation functions such as fetchGitHubLFS, etc. + # upon which local package defintions are dependent. + localLib = pkgs.callPackage ./nix/lib { }; - deps // pkgs + # Utilise nixpkgs's top-level/static.nix overlay if required. + hostPackages = if enableStatic then pkgs.pkgsStatic else pkgs; + + # Enrich the global package set with our local functions and packages. + callPackage = + pkgs.lib.callPackageWith (hostPackages // localLib // localPackages); + + # Local vendored packages defined in ./pkg. + # For non-vendored nixpkgs specific package overrides, see ./nix/overlays. + localPackages = { + argon2u = callPackage ./nix/pkgs/argon2u { }; + + ca-bundle = callPackage ./nix/pkgs/ca-bundle { }; + + ed25519 = callPackage ./nix/pkgs/ed25519 { }; + + ent = callPackage ./nix/pkgs/ent { }; + + ge-additions = callPackage ./nix/pkgs/ge-additions { }; + + libaes_siv = callPackage ./nix/pkgs/libaes_siv { }; + + libscrypt = callPackage ./nix/pkgs/libscrypt { }; + + murmur3 = callPackage ./nix/pkgs/murmur3 { }; + + softfloat3 = callPackage ./nix/pkgs/softfloat3 { }; + + herb = callPackage ./nix/pkgs/herb { inherit (pkgs) python; }; + + arvo = callPackage ./nix/pkgs/arvo { }; + + ivory = callPackage ./nix/pkgs/pill/ivory.nix { }; + + brass = callPackage ./nix/pkgs/pill/brass.nix { }; + + solid = callPackage ./nix/pkgs/pill/solid.nix { }; + + urbit = callPackage ./nix/pkgs/urbit { inherit enableStatic; }; + + hs = callPackage ./nix/pkgs/hs { + inherit (pkgs) haskell-nix; + inherit checkMaterialization enableStatic; + }; + }; + + # Additional top-level packages and attributes exposed for convenience. + extraPackages = with localPackages; { + # Expose packages we've local customisations for. + inherit (hostPackages) libsigsegv; + + urbit-debug = urbit.override { enableDebug = true; }; + urbit-tests = localLib.testFakeShip { + inherit urbit herb; + + pill = solid.lfs; + }; + + ivory-ropsten = ivory.override { arvo = arvo.ropsten; }; + brass-ropsten = brass.override { arvo = arvo.ropsten; }; + + # FIXME: tarball binaries need executable permissions set? + + # Create a .tar.gz of the primary binaries. + tarball = localLib.makeReleaseTarball { + name = "urbit-tarball"; + contents = { + "urbit" = "${urbit}/bin/urbit"; + "urbit-worker" = "${urbit}/bin/urbit-worker"; + "urbit-king" = + "${hs.urbit-king.components.exes.urbit-king}/bin/urbit-king"; + }; + }; + + # A convenience function for constructing a shell.nix for any of the + # localPackage derivations by automatically propagating any dependencies such + # as buildInputs to the nix-shell. + # + # Example: + # + # let + # pkgs = import ./default.nix { }; + # in pkgs.shellFor { + # packages = ps: [ + # ps.urbit + # ps.herb + # ]; + # } + # + shellFor = { name, packages, ... }@attrs: + pkgs.mkShell ({ + inputsFrom = packages localPackages; + } // builtins.removeAttrs attrs [ "packages" ]); + }; + + # Ensure that in the case of cross-compilation we're not statically linking + # against glibc. This is typically a sign that crossSystem is misconfigured. + checkPlatform = + if enableStatic && hostPackages.stdenv.hostPlatform.libc == "glibc" then + builtins.trace "warning: statically linking against glibc." + else + pkgs.lib.id; + +in checkPlatform (localPackages // extraPackages) diff --git a/nix/cachix/local.nix b/nix/cachix/local.nix deleted file mode 100644 index 753a00a0cd..0000000000 --- a/nix/cachix/local.nix +++ /dev/null @@ -1,22 +0,0 @@ -# All the non-release builds that should be cached in `cachix`. - -let - - pkgs = import ../pkgs {}; - deps = import ../deps {}; - - # Cache the result of cloning source repos. - repos = { - argon2-src = deps.argon2.src; - ed25519-src = deps.ed25519.src; - h2o-src = deps.h2o.src; - murmur3-src = deps.murmur3.src; - scrypt-src = deps.scrypt.src; - secp256k1-src = deps.secp256k1.src; - softfloat3-src = deps.softfloat3.src; - uv-src = deps.uv.src; - }; - -in - - deps // pkgs // repos diff --git a/nix/cachix/release.nix b/nix/cachix/release.nix deleted file mode 100644 index bc63f052ac..0000000000 --- a/nix/cachix/release.nix +++ /dev/null @@ -1,11 +0,0 @@ -let - - util = import ./util.nix; - nixcrpkgs = import ../nixcrpkgs.nix; - release = import ../release.nix; - all_releases = util.flattenSetPrefix release; - crosstools = { inherit (nixcrpkgs.native) pkgconf; }; - -in - - crosstools // all_releases diff --git a/nix/cachix/tests.nix b/nix/cachix/tests.nix deleted file mode 100644 index 2248a5cea2..0000000000 --- a/nix/cachix/tests.nix +++ /dev/null @@ -1,7 +0,0 @@ -let - ops = import ../ops/default.nix {}; -in - { - results = ops.test; - fakebus = ops.bus; - } diff --git a/nix/cachix/util.nix b/nix/cachix/util.nix deleted file mode 100644 index 6eada20f4c..0000000000 --- a/nix/cachix/util.nix +++ /dev/null @@ -1,26 +0,0 @@ -# Some utility functions: - -rec { - - # The inverse of builtins.listToAttrs - attrsToList = o: - map (a: { name=a; value=builtins.getAttr a o; }) - (builtins.attrNames o); - - # ∀o,x,y. produce o' such that o'.y == o.x.y (assuming no conflicts) - flattenSet = o: - builtins.foldl' (acc: v: acc // v) {} - (builtins.attrValues o); - - prefixSetAttrs = prefix: o: - builtins.listToAttrs - (map ({name, value}: { name=prefix + name; value=value; }) - (attrsToList o)); - - # ∀o,x,y. produce o' such that o'.x-y == o.x.y - flattenSetPrefix = o: - (builtins.foldl' (acc: o: acc // o) {} - (map ({name, value}: prefixSetAttrs name value) - (attrsToList o))); - -} diff --git a/nix/crossdeps.nix b/nix/crossdeps.nix deleted file mode 100644 index e942b842b6..0000000000 --- a/nix/crossdeps.nix +++ /dev/null @@ -1,14 +0,0 @@ -crossenv: - -rec { - argon2 = import ./deps/argon2/cross.nix { inherit crossenv; }; - murmur3 = import ./deps/murmur3/cross.nix { inherit crossenv; }; - uv = import ./deps/uv/cross.nix { inherit crossenv; }; - ed25519 = import ./deps/ed25519/cross.nix { inherit crossenv; }; - scrypt = import ./deps/scrypt/cross.nix { inherit crossenv; }; - softfloat3 = import ./deps/softfloat3/cross.nix { inherit crossenv; }; - secp256k1 = import ./deps/secp256k1/cross.nix { inherit crossenv; }; - h2o = import ./deps/h2o/cross.nix { inherit crossenv uv; }; - ivory-header = import ./deps/ivory-header/cross.nix { inherit crossenv; }; - ca-header = import ./deps/ca-header/cross.nix { inherit crossenv; }; -} diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000000..bef5c54a7b --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,45 @@ +# The build system where packages will be _built_. +{ system ? builtins.currentSystem + # The host system where packages will _run_. +, crossSystem ? null + # Additional sources.json overrides. +, sources ? { } + # Additional nixpkgs.config overrides. +, config ? { } + # Additional nixpkgs.overlays. +, overlays ? [ ] + # Overlays to apply to the last package set in cross compilation. +, crossOverlays ? [ ] }: + +let + + finalSources = import ./sources.nix { inherit pkgs; } // sources; + + haskellNix = import finalSources."haskell.nix" { + sourcesOverride = { + hackage = finalSources."hackage.nix"; + stackage = finalSources."stackage.nix"; + }; + }; + + finalOverlays = [ + # Add top-level .sources attribute for other overlays to access niv sources. + (_final: _prev: { sources = finalSources; }) + + # General unguarded (native) overrides for nixpkgs. + (import ./overlays/native.nix) + + # Specific overrides guarded by the host platform. + (import ./overlays/musl.nix) + ] ++ haskellNix.overlays ++ overlays; + + pkgs = import finalSources.nixpkgs { + inherit system crossSystem crossOverlays; + + config = haskellNix.config // config; + overlays = finalOverlays; + }; + +in pkgs // { + pkgsStatic = pkgs.pkgsStatic.extend (import ./overlays/static.nix); +} diff --git a/nix/deps-env.nix b/nix/deps-env.nix deleted file mode 100644 index 6f7357b4f6..0000000000 --- a/nix/deps-env.nix +++ /dev/null @@ -1,31 +0,0 @@ -let - - pkgs = import ./nixpkgs.nix; - tlon = import ./pkgs { pkgs=pkgs; }; - deps = import ./deps { pkgs=pkgs; }; - - tools = - with pkgs; - [ cargo rustc meson ninja pkgconfig libtool gdb ]; - - libs = - with pkgs; - [ openssl curl gmp scrypt libsigsegv openssl zlib lmdb ]; - - osx = - with pkgs; - lib.optionals stdenv.isDarwin ( - with darwin.apple_sdk.frameworks; - [ Cocoa CoreServices ]); - - vendor = - with deps; - [ argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ent ge-additions ivory-header ca-header ]; - -in - -pkgs.stdenv.mkDerivation rec { - name = "urbit-deps-env"; - env = pkgs.buildEnv { name = name; paths = buildInputs; }; - buildInputs = tools ++ libs ++ osx ++ vendor; -} diff --git a/nix/deps/argon2/builder.sh b/nix/deps/argon2/builder.sh deleted file mode 100644 index 9430b939f9..0000000000 --- a/nix/deps/argon2/builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $stdenv/setup - -cp -r $src ./src -chmod -R a+w ./src -cd ./src - -sed -i 's|ar rcs|${AR} rcs|' Makefile - -make libargon2.a -j4 - -mkdir -p $out/{lib,include} -cp libargon2.a $out/lib -cp include/argon2.h $out/include -cp ./src/blake2/*.h $out/include diff --git a/nix/deps/argon2/cross.nix b/nix/deps/argon2/cross.nix deleted file mode 100644 index f7776d03ee..0000000000 --- a/nix/deps/argon2/cross.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "argon2-4da94"; - builder = ./builder.sh; - - CC = "${crossenv.host}-gcc"; - AR = "${crossenv.host}-ar"; - NO_THREADS = true; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "urbit"; - repo = "argon2"; - rev = "4da94a611ee62bad87ab2b131ffda3bcc0723d9c"; - sha256 = "0bqq1hg367l4jkb6cqhxlblpvdbwz3l586qsfakwzfd9wdvnm3yc"; - }; -} diff --git a/nix/deps/argon2/default.nix b/nix/deps/argon2/default.nix deleted file mode 100644 index e101ca6968..0000000000 --- a/nix/deps/argon2/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs }: - -pkgs.stdenv.mkDerivation rec { - name = "argon2-4da94"; - builder = ./builder.sh; - NO_THREADS = true; - src = pkgs.fetchFromGitHub { - owner = "urbit"; - repo = "argon2"; - rev = "4da94a611ee62bad87ab2b131ffda3bcc0723d9c"; - sha256 = "0bqq1hg367l4jkb6cqhxlblpvdbwz3l586qsfakwzfd9wdvnm3yc"; - }; -} diff --git a/nix/deps/ca-header/builder.sh b/nix/deps/ca-header/builder.sh deleted file mode 100755 index 413a515ec4..0000000000 --- a/nix/deps/ca-header/builder.sh +++ /dev/null @@ -1,27 +0,0 @@ -source $stdenv/setup - -set -ex - -cleanup () { - echo "done" -} - -trap cleanup EXIT - - -if ! [ -f "$SSL_CERT_FILE" ]; then - echo "$SSL_CERT_FILE doesn't exist" - exit 1 -fi - -mkdir -p ./include - -cat $SSL_CERT_FILE > include/ca-bundle.crt -xxd -i include/ca-bundle.crt > ca-bundle.h - -mkdir -p $out/include - -mv ca-bundle.h $out/include -rm -rf ./include - -set +x diff --git a/nix/deps/ca-header/cross.nix b/nix/deps/ca-header/cross.nix deleted file mode 100644 index 2595eb01a9..0000000000 --- a/nix/deps/ca-header/cross.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "ca-bundle.h"; - builder = ./builder.sh; - native_inputs = with crossenv.nixpkgs; [ cacert xxd ]; - SSL_CERT_FILE = "${crossenv.nixpkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; -} diff --git a/nix/deps/ca-header/default.nix b/nix/deps/ca-header/default.nix deleted file mode 100644 index 6e65f14547..0000000000 --- a/nix/deps/ca-header/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs }: - -pkgs.stdenv.mkDerivation { - name = "ca-bundle.h"; - builder = ./builder.sh; - nativeBuildInputs = with pkgs; [ cacert xxd ]; -} diff --git a/nix/deps/default.nix b/nix/deps/default.nix deleted file mode 100644 index 8f44e75015..0000000000 --- a/nix/deps/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs ? import ../nixpkgs.nix }: - -rec { - argon2 = import ./argon2 { inherit pkgs; }; - murmur3 = import ./murmur3 { inherit pkgs; }; - uv = import ./uv { inherit pkgs; }; - ed25519 = import ./ed25519 { inherit pkgs; }; - scrypt = import ./scrypt { inherit pkgs; }; - softfloat3 = import ./softfloat3 { inherit pkgs; }; - secp256k1 = import ./secp256k1 { inherit pkgs; }; - h2o = import ./h2o { inherit pkgs uv; }; - ivory-header = import ./ivory-header { inherit pkgs; }; - ca-header = import ./ca-header { inherit pkgs; }; -} diff --git a/nix/deps/ed25519/builder.sh b/nix/deps/ed25519/builder.sh deleted file mode 100644 index e37423356f..0000000000 --- a/nix/deps/ed25519/builder.sh +++ /dev/null @@ -1,29 +0,0 @@ -source $stdenv/setup - -sources=" \ - $src/src/add_scalar.c \ - $src/src/seed.c \ - $src/src/verify.c \ - $src/src/add_scalar.c \ - $src/src/sha512.c \ - $src/src/ge.c \ - $src/src/fe.c \ - $src/src/keypair.c \ - $src/src/sign.c \ - $src/src/sc.c \ - $src/src/key_exchange.c \ -" - -CFLAGS="-O3 -Wall -I$src/src" - -for fn in $sources -do echo $CC $CFLAGS -c $fn -o $(basename $fn).o - $CC -O3 -Wall -I$src/src -c $fn -o $(basename $fn).o -done - -mkdir -p $out/{lib,include} - -$AR rcs $out/lib/libed25519.a *.o -echo $AR rcs $out/lib/libed25519.a *.o - -cp $src/src/*.h $out/include diff --git a/nix/deps/ed25519/cross.nix b/nix/deps/ed25519/cross.nix deleted file mode 100644 index 76ae2a5d52..0000000000 --- a/nix/deps/ed25519/cross.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "ed25519-76385"; - builder = ./builder.sh; - - CC = "${crossenv.host}-gcc"; - AR = "${crossenv.host}-ar"; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "urbit"; - repo = "ed25519"; - rev = "76385f2ebbbc9580a9c236952d68d11d73a6135c"; - sha256 = "0s1spif4s9lgcwcny3fl2fvpbw6acqn3s8r6qxnrmkd9icgyw4cp"; - }; -} diff --git a/nix/deps/ed25519/default.nix b/nix/deps/ed25519/default.nix deleted file mode 100644 index 4d4ee42c83..0000000000 --- a/nix/deps/ed25519/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs }: - -pkgs.stdenv.mkDerivation rec { - name = "ed25519-76385"; - builder = ./builder.sh; - src = pkgs.fetchFromGitHub { - owner = "urbit"; - repo = "ed25519"; - rev = "76385f2ebbbc9580a9c236952d68d11d73a6135c"; - sha256 = "0s1spif4s9lgcwcny3fl2fvpbw6acqn3s8r6qxnrmkd9icgyw4cp"; - }; -} diff --git a/nix/deps/h2o/builder.sh b/nix/deps/h2o/builder.sh deleted file mode 100644 index 4c5c71723b..0000000000 --- a/nix/deps/h2o/builder.sh +++ /dev/null @@ -1,109 +0,0 @@ -source $stdenv/setup - -sources=" \ - deps/cloexec/cloexec.c \ - deps/libgkc/gkc.c \ - deps/libyrmcds/close.c \ - deps/libyrmcds/connect.c \ - deps/libyrmcds/recv.c \ - deps/libyrmcds/send.c \ - deps/libyrmcds/send_text.c \ - deps/libyrmcds/socket.c \ - deps/libyrmcds/strerror.c \ - deps/libyrmcds/text_mode.c \ - deps/picohttpparser/picohttpparser.c \ - lib/common/cache.c \ - lib/common/file.c \ - lib/common/filecache.c \ - lib/common/hostinfo.c \ - lib/common/http1client.c \ - lib/common/memcached.c \ - lib/common/memory.c \ - lib/common/multithread.c \ - lib/common/serverutil.c \ - lib/common/socket.c \ - lib/common/socketpool.c \ - lib/common/string.c \ - lib/common/time.c \ - lib/common/timeout.c \ - lib/common/url.c \ - lib/core/config.c \ - lib/core/configurator.c \ - lib/core/context.c \ - lib/core/headers.c \ - lib/core/logconf.c \ - lib/core/proxy.c \ - lib/core/request.c \ - lib/core/token.c \ - lib/core/util.c \ - lib/handler/access_log.c \ - lib/handler/chunked.c \ - lib/handler/compress.c \ - lib/handler/compress/gzip.c \ - lib/handler/errordoc.c \ - lib/handler/expires.c \ - lib/handler/fastcgi.c \ - lib/handler/file.c \ - lib/handler/headers.c \ - lib/handler/mimemap.c \ - lib/handler/proxy.c \ - lib/handler/redirect.c \ - lib/handler/reproxy.c \ - lib/handler/throttle_resp.c \ - lib/handler/status.c \ - lib/handler/headers_util.c \ - lib/handler/status/events.c \ - lib/handler/status/requests.c \ - lib/handler/http2_debug_state.c \ - lib/handler/status/durations.c \ - lib/handler/configurator/access_log.c \ - lib/handler/configurator/compress.c \ - lib/handler/configurator/errordoc.c \ - lib/handler/configurator/expires.c \ - lib/handler/configurator/fastcgi.c \ - lib/handler/configurator/file.c \ - lib/handler/configurator/headers.c \ - lib/handler/configurator/proxy.c \ - lib/handler/configurator/redirect.c \ - lib/handler/configurator/reproxy.c \ - lib/handler/configurator/throttle_resp.c \ - lib/handler/configurator/status.c \ - lib/handler/configurator/http2_debug_state.c \ - lib/handler/configurator/headers_util.c \ - lib/http1.c \ - lib/tunnel.c \ - lib/http2/cache_digests.c \ - lib/http2/casper.c \ - lib/http2/connection.c \ - lib/http2/frame.c \ - lib/http2/hpack.c \ - lib/http2/scheduler.c \ - lib/http2/stream.c \ - lib/http2/http2_debug_state.c \ -" - -CFLAGS=" \ - -O3 \ - -Wall -Wno-unused-value -Wno-unused-function \ - -I$src/include \ - -I$src/deps/cloexec \ - -I$src/deps/brotli/enc \ - -I$src/deps/golombset \ - -I$src/deps/libgkc \ - -I$src/deps/libyrmcds \ - -I$src/deps/klib \ - -I$src/deps/neverbleed \ - -I$src/deps/picohttpparser \ - -I$src/deps/picotest \ - -I$src/deps/yaml/include \ - -I$src/deps/yoml -" - -for s in $sources -do cc $CFLAGS -c $src/$s -o $(sed 's|/|_|g; s/.c$/.o/' <<< $s) -done - -mkdir -p $out/{lib,include} -ar rcs $out/lib/libh2o.a *.o -cp -r $src/include/* $out/include -cp $src/deps/picohttpparser/picohttpparser.h $out/include diff --git a/nix/deps/h2o/cross.nix b/nix/deps/h2o/cross.nix deleted file mode 100644 index 49b6ce3dee..0000000000 --- a/nix/deps/h2o/cross.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ crossenv, uv }: - -crossenv.make_derivation rec { - inherit (crossenv) openssl zlib; - inherit uv; - - name = "h2o-0ed9a"; - cross_inputs = [ uv crossenv.openssl crossenv.zlib ]; - builder = ./cross.sh; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "urbit"; - repo = "h2o"; - rev = "0ed9ac70757a16ec45f91b8a347850d9699c3fb1"; - sha256 = "16b5zbwdq371hhqga76dh7x4c0qr3xb5ah9r8hnm6rip460p6xpm"; - }; -} diff --git a/nix/deps/h2o/cross.sh b/nix/deps/h2o/cross.sh deleted file mode 100644 index e91314996b..0000000000 --- a/nix/deps/h2o/cross.sh +++ /dev/null @@ -1,26 +0,0 @@ -source $stdenv/setup - -cp -r $src src -chmod -R u+w src -cd src - -cmake-cross . \ - -DZLIB_LIBRARY=$zlib/lib/libz.a \ - -DZLIB_INCLUDE_DIR=$zlib/include \ - -DCMAKE_INSTALL_PREFIX=$out \ - -DBUILD_SHARED_LIBS=off \ - -DWITH_MRUBY=off \ - -DWITH_BUNDLED_SSL=off \ - -DWITH_PICOTLS=on - -make libh2o - -mkdir -p $out/{lib,lib/pkgconfig,include} - -cp ./libh2o.a $out/lib - -cp ./libh2o.pc $out/lib/pkgconfig - -cp -r include/* $out/include - -cp deps/picohttpparser/picohttpparser.h $out/include diff --git a/nix/deps/h2o/default.nix b/nix/deps/h2o/default.nix deleted file mode 100644 index 101edbeb78..0000000000 --- a/nix/deps/h2o/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, uv }: - -pkgs.stdenv.mkDerivation rec { - name = "h2o-0ed9a"; - buildInputs = [ uv pkgs.openssl pkgs.zlib ]; - builder = ./builder.sh; - src = pkgs.fetchFromGitHub { - owner = "urbit"; - repo = "h2o"; - rev = "0ed9ac70757a16ec45f91b8a347850d9699c3fb1"; - sha256 = "16b5zbwdq371hhqga76dh7x4c0qr3xb5ah9r8hnm6rip460p6xpm"; - }; -} diff --git a/nix/deps/ivory-header/builder.sh b/nix/deps/ivory-header/builder.sh deleted file mode 100755 index 225ed8a608..0000000000 --- a/nix/deps/ivory-header/builder.sh +++ /dev/null @@ -1,35 +0,0 @@ -source $stdenv/setup - -set -e - -if ! [ -f "$IVORY" ]; then - echo "$IVORY doesn't exist" - exit 1 -fi - -# -# heuristics to confirm the ivory pill is valid -# - -# first 7 bytes != "version" (start of an lfs pointer) -# -if [ "$(head -c 7 "$IVORY")" = "version" ]; then - echo "$IVORY is an LFS pointer (it starts with 'version')" - echo "to fix, run: git lfs install" - exit 1 -fi - -# greater than 10KB -# -if ! [ $(du -k "$IVORY" | cut -f1) -gt 10 ]; then - echo "$IVORY is less than 10KB" - exit 1 -fi - -cat $IVORY > u3_Ivory.pill -xxd -i u3_Ivory.pill > ivory.h - -mkdir -p $out/include - -mv ivory.h $out/include -rm u3_Ivory.pill diff --git a/nix/deps/ivory-header/cross.nix b/nix/deps/ivory-header/cross.nix deleted file mode 100644 index 6939a84de0..0000000000 --- a/nix/deps/ivory-header/cross.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - crossenv, - ivory ? ../../../bin/ivory.pill -}: - -crossenv.make_derivation rec { - name = "ivory.h"; - builder = ./builder.sh; - native_inputs = with crossenv.nixpkgs; [ xxd ]; - IVORY = ivory; -} diff --git a/nix/deps/ivory-header/default.nix b/nix/deps/ivory-header/default.nix deleted file mode 100644 index 0e461a7cab..0000000000 --- a/nix/deps/ivory-header/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - pkgs, - ivory ? ../../../bin/ivory.pill -}: - -pkgs.stdenv.mkDerivation { - name = "ivory.h"; - builder = ./builder.sh; - nativeBuildInputs = with pkgs; [ xxd ]; - IVORY = ivory; -} diff --git a/nix/deps/murmur3/builder.sh b/nix/deps/murmur3/builder.sh deleted file mode 100644 index 9afd6918a0..0000000000 --- a/nix/deps/murmur3/builder.sh +++ /dev/null @@ -1,11 +0,0 @@ -source $stdenv/setup - -echo $CC -fPIC -O3 -o murmur3.o -c $src/murmur3.c -$CC -fPIC -O3 -o murmur3.o -c $src/murmur3.c - -mkdir -p $out/{lib,include} - -echo $AR rcs $out/lib/libmurmur3.a murmur3.o -$AR rcs $out/lib/libmurmur3.a murmur3.o - -cp $src/murmur3.h $out/include diff --git a/nix/deps/murmur3/cross.nix b/nix/deps/murmur3/cross.nix deleted file mode 100644 index 024f58656d..0000000000 --- a/nix/deps/murmur3/cross.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "murmur3-71a75"; - builder = ./builder.sh; - - CC = "${crossenv.host}-gcc"; - AR = "${crossenv.host}-ar"; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "urbit"; - repo = "murmur3"; - rev = "71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca"; - sha256 = "0k7jq2nb4ad9ajkr6wc4w2yy2f2hkwm3nkbj2pklqgwsg6flxzwg"; - }; -} diff --git a/nix/deps/murmur3/default.nix b/nix/deps/murmur3/default.nix deleted file mode 100644 index 01c0ae9cf2..0000000000 --- a/nix/deps/murmur3/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs }: - -pkgs.stdenv.mkDerivation rec { - name = "murmur3-71a75"; - builder = ./builder.sh; - src = pkgs.fetchFromGitHub { - owner = "urbit"; - repo = "murmur3"; - rev = "71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca"; - sha256 = "0k7jq2nb4ad9ajkr6wc4w2yy2f2hkwm3nkbj2pklqgwsg6flxzwg"; - }; -} diff --git a/nix/deps/scrypt/builder.sh b/nix/deps/scrypt/builder.sh deleted file mode 100644 index 94e03d0314..0000000000 --- a/nix/deps/scrypt/builder.sh +++ /dev/null @@ -1,27 +0,0 @@ -source $stdenv/setup - -sources=" \ - crypto_scrypt-check \ - crypto_scrypt-hash \ - crypto_scrypt-hexconvert \ - crypto_scrypt-nosse \ - crypto-mcf \ - crypto-scrypt-saltgen \ - slowequals \ - sha256 \ - b64 \ -" - -CFLAGS="-I$src -Wall -ffast-math -O3 -D_FORTIFY_SOURCE=2 -fstack-protector" - -for s in $sources -do echo $CC $CFLAGS -c $src/$s.c -o $s.o - $CC $CFLAGS -c $src/$s.c -o $s.o -done - -echo $AR rcs libscrypt.a *.o -$AR rcs libscrypt.a *.o - -mkdir -p $out/{lib,include} -cp libscrypt.a $out/lib -cp $src/*.h $out/include diff --git a/nix/deps/scrypt/cross.nix b/nix/deps/scrypt/cross.nix deleted file mode 100644 index 9a74e5b65e..0000000000 --- a/nix/deps/scrypt/cross.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "scrypt-02969"; - builder = ./builder.sh; - - CC = "${crossenv.host}-gcc"; - AR = "${crossenv.host}-ar"; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "urbit"; - repo = "libscrypt"; - rev = "029693ff1cbe4f69d3a2da87d0f4f034f92cc0c2"; - sha256 = "17pcxypzjmmrvacw45cacvibm6mlr9ip30hy30l1appsnywx679n"; - }; -} diff --git a/nix/deps/scrypt/default.nix b/nix/deps/scrypt/default.nix deleted file mode 100644 index a0740f9e1e..0000000000 --- a/nix/deps/scrypt/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs }: - -pkgs.stdenv.mkDerivation rec { - name = "scrypt-02969"; - builder = ./builder.sh; - src = pkgs.fetchFromGitHub { - owner = "urbit"; - repo = "libscrypt"; - rev = "029693ff1cbe4f69d3a2da87d0f4f034f92cc0c2"; - sha256 = "17pcxypzjmmrvacw45cacvibm6mlr9ip30hy30l1appsnywx679n"; - }; -} diff --git a/nix/deps/secp256k1/builder.sh b/nix/deps/secp256k1/builder.sh deleted file mode 100644 index 9e5a114152..0000000000 --- a/nix/deps/secp256k1/builder.sh +++ /dev/null @@ -1,11 +0,0 @@ -source $stdenv/setup - -cp -r $src ./src -chmod -R u+w ./src -cd src - -libtoolize -bash ./autogen.sh -bash ./configure --prefix=$out --host=$host $configureFlags -make -make install diff --git a/nix/deps/secp256k1/cross.nix b/nix/deps/secp256k1/cross.nix deleted file mode 100644 index 67ac2379de..0000000000 --- a/nix/deps/secp256k1/cross.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "secp256k1-b4e87"; - builder = ./builder.sh; - - CFLAGS = "-fPIC"; - - configureFlags = [ - "--disable-shared" - "--enable-module-recovery" - ]; - - cross_inputs = [ crossenv.libgmp ]; - native_inputs = - with crossenv.nixpkgs; - [ autoconf automake libtool m4 ]; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "bitcoin-core"; - repo = "secp256k1"; - rev = "e34ceb333b1c0e6f4115ecbb80c632ac1042fa49"; - sha256 = "0as78s179hcr3ysk3fw98k5wzabgnwri7vkkc17wg31lyz6ids6c"; - }; -} diff --git a/nix/deps/secp256k1/default.nix b/nix/deps/secp256k1/default.nix deleted file mode 100644 index 438b2dc25d..0000000000 --- a/nix/deps/secp256k1/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs }: - -pkgs.stdenv.mkDerivation rec { - name = "secp256k1-b4e87"; - builder = ./builder.sh; - - CFLAGS = "-fPIC"; - - configureFlags = [ - "--disable-shared" - "--enable-module-recovery" - ]; - - buildInputs = [ pkgs.gmp ]; - nativeBuildInputs = - with pkgs; - [ autoconf automake libtool m4 ]; - - src = pkgs.fetchFromGitHub { - owner = "bitcoin-core"; - repo = "secp256k1"; - rev = "e34ceb333b1c0e6f4115ecbb80c632ac1042fa49"; - sha256 = "0as78s179hcr3ysk3fw98k5wzabgnwri7vkkc17wg31lyz6ids6c"; - }; -} diff --git a/nix/deps/softfloat3/builder.sh b/nix/deps/softfloat3/builder.sh deleted file mode 100644 index 6a8efbaf85..0000000000 --- a/nix/deps/softfloat3/builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $stdenv/setup - -cp -r $src $TMP/$name -chmod -R u+w $TMP/$name -cd $TMP/$name - -cd ./build/Linux-386-SSE2-GCC -sed -i 's|gcc|$(CC)|' Makefile -sed -i 's/ar crs/$(AR) crs/' Makefile - -make -j4 - -mkdir -p $out/{lib,include} -cp $src/source/include/*.h $out/include -cp softfloat.a $out/lib/libsoftfloat3.a diff --git a/nix/deps/softfloat3/cross.nix b/nix/deps/softfloat3/cross.nix deleted file mode 100644 index 9d76c7e699..0000000000 --- a/nix/deps/softfloat3/cross.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "softfloat3-ec4c7"; - builder = ./builder.sh; - - CC = "${crossenv.host}-gcc"; - AR = "${crossenv.host}-ar"; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "urbit"; - repo = "berkeley-softfloat-3"; - rev = "ec4c7e31b32e07aad80e52f65ff46ac6d6aad986"; - sha256 = "1lz4bazbf7lns1xh8aam19c814a4n4czq5xsq5rmi9sgqw910339"; - }; -} diff --git a/nix/deps/softfloat3/default.nix b/nix/deps/softfloat3/default.nix deleted file mode 100644 index c101b28c24..0000000000 --- a/nix/deps/softfloat3/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs }: - -pkgs.stdenv.mkDerivation rec { - name = "softfloat3-ec4c7"; - builder = ./builder.sh; - src = pkgs.fetchFromGitHub { - owner = "urbit"; - repo = "berkeley-softfloat-3"; - rev = "ec4c7e31b32e07aad80e52f65ff46ac6d6aad986"; - sha256 = "1lz4bazbf7lns1xh8aam19c814a4n4czq5xsq5rmi9sgqw910339"; - }; -} diff --git a/nix/deps/uv/builder.sh b/nix/deps/uv/builder.sh deleted file mode 100644 index d9f0ff42c0..0000000000 --- a/nix/deps/uv/builder.sh +++ /dev/null @@ -1,9 +0,0 @@ -source $stdenv/setup - -cp -r $src ./src -chmod -R a+w ./src -cd ./src - -LIBTOOLIZE=libtoolize ./autogen.sh -bash ./configure --prefix=$out --host=$host $configureFlags -make install diff --git a/nix/deps/uv/cross.nix b/nix/deps/uv/cross.nix deleted file mode 100644 index 4e81e4bd7b..0000000000 --- a/nix/deps/uv/cross.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "uv-64294"; - native_inputs = with crossenv.nixpkgs; [ autoconf automake libtool m4 ]; - builder = ./builder.sh; - - configureFlags = [ "--disable-shared" ]; - CFLAGS = "-fPIC"; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "urbit"; - repo = "libuv"; - rev = "6429495dc9a80aaf1c243038b381451f12bc7dcf"; - sha256 = "07m2m4v9mds0wihzjxjwswwfj3rnk2ycr3vgwfcrvnb5xjz7rs15"; - }; -} diff --git a/nix/deps/uv/default.nix b/nix/deps/uv/default.nix deleted file mode 100644 index ecf8383d26..0000000000 --- a/nix/deps/uv/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ pkgs }: - -let - - osx = - with pkgs; - lib.optionals stdenv.isDarwin ( - with darwin.apple_sdk.frameworks; - [ Cocoa CoreServices ]); - -in - -pkgs.stdenv.mkDerivation rec { - name = "uv-64294"; - buildInputs = osx ++ (with pkgs; [ autoconf automake libtool m4 ]); - builder = ./builder.sh; - - CFLAGS = "-fPIC"; - configureFlags = [ "--disable-shared" ]; - - src = pkgs.fetchFromGitHub { - owner = "urbit"; - repo = "libuv"; - rev = "6429495dc9a80aaf1c243038b381451f12bc7dcf"; - sha256 = "07m2m4v9mds0wihzjxjwswwfj3rnk2ycr3vgwfcrvnb5xjz7rs15"; - }; -} diff --git a/nix/lib/boot-fake-ship.nix b/nix/lib/boot-fake-ship.nix new file mode 100644 index 0000000000..e189818e47 --- /dev/null +++ b/nix/lib/boot-fake-ship.nix @@ -0,0 +1,57 @@ +{ stdenvNoCC, cacert }: + +{ urbit, herb, arvo ? null, pill, ship }: + +stdenvNoCC.mkDerivation { + name = "fake-${ship}"; + + buildInputs = [ cacert urbit herb ]; + + phases = [ "buildPhase" "installPhase " ]; + + buildPhase = '' + set -xeuo pipefail + + if ! [ -f "$SSL_CERT_FILE" ]; then + header "$SSL_CERT_FILE doesn't exist" + exit 1 + fi + + ARVO=${if arvo == null then "" else arvo} + PILL=${pill} + SHIP=${ship} + + if [ -z "$ARVO" ]; then + urbit -d -F "$SHIP" -B "$PILL" ./pier + else + urbit -d -F "$SHIP" -A "$ARVO" -B "$PILL" ./pier + fi + + cleanup () { + if [ -f ./pier/.vere.lock ]; then + kill $(< ./pier/.vere.lock) || true + fi + + set +x + } + + trap cleanup EXIT + + check () { + [ 3 -eq "$(herb ./pier -d 3)" ] + } + + if check && sleep 10 && check; then + header "boot success" + herb ./pier -p hood -d '+hood/exit' + else + header "boot failure" + kill $(< ./pier/.vere.lock) || true + exit 1 + fi + ''; + + installPhase = '' + mv ./pier $out + ''; +} diff --git a/nix/lib/default.nix b/nix/lib/default.nix new file mode 100644 index 0000000000..d14915c9bc --- /dev/null +++ b/nix/lib/default.nix @@ -0,0 +1,81 @@ +{ lib, recurseIntoAttrs, haskell-nix, callPackage }: + +let + + # Fetchers + Import from derivations (IFDs) + fetchers = { + bootFakeShip = callPackage ./boot-fake-ship.nix { }; + + testFakeShip = callPackage ./test-fake-ship.nix { }; + + fetchGitHubLFS = callPackage ./fetch-github-lfs.nix { }; + + makeReleaseTarball = callPackage ./make-release-tarball.nix { }; + + pushStorageObject = callPackage ./push-storage-object.nix { }; + }; + +in fetchers // rec { + # Library functions + + inherit (import ./dimension.nix) dimension; + + # A filter for removing packages that aren't supported on the current platform + # according to 'meta.platforms'. + platformFilterGeneric = system: + # This needs to use the correct nixpkgs version so all the systems line up + let + platform = lib.systems.elaborate { inherit system; }; + # Can't just default to [] for platforms, since no meta.platforms + # means "all platforms" not "no platforms" + in drv: + if drv ? meta && drv.meta ? platforms then + lib.any (lib.meta.platformMatch platform) drv.meta.platforms + else + true; + + # Keep derivations and attrsets with 'recurseForDerivations'. + # This ensures that we match the derivations that Hercules will see. + filterDerivations = filterAttrsOnlyRecursive + (n: attrs: lib.isDerivation attrs || attrs.recurseForDerivations or false); + + # A version of 'filterAttrsRecursive' that doesn't recurse into derivations. + # This prevents us from going into an infinite loop with the 'out' attribute + # on derivations. + filterAttrsOnlyRecursive = pred: set: + lib.listToAttrs (lib.concatMap (name: + let v = set.${name}; + in if pred name v then + [ + (lib.nameValuePair name + (if builtins.isAttrs v && !lib.isDerivation v then + filterAttrsOnlyRecursive pred v + else + v)) + ] + else + [ ]) (builtins.attrNames set)); + + collectHaskellComponents = packages: + let + + # These functions pull out from the Haskell package set either all the + # components of a particular type, or all the checks. + + collectChecks = _: ps: + recurseIntoAttrs (builtins.mapAttrs (_: p: p.checks) ps); + + collectComponents = type: ps: + haskell-nix.haskellLib.collectComponents' type ps; + + # This computes the Haskell package set sliced by component type + in recurseIntoAttrs (dimension "haskell" { + # These names must match the subcomponent: components..<...> + "library" = collectComponents; + "tests" = collectComponents; + "benchmarks" = collectComponents; + "exes" = collectComponents; + "checks" = collectChecks; + } # Apply the selector to the Haskell package set + (type: selector: (selector type) packages)); +} diff --git a/nix/lib/dimension.nix b/nix/lib/dimension.nix new file mode 100644 index 0000000000..b4dcaf5eb8 --- /dev/null +++ b/nix/lib/dimension.nix @@ -0,0 +1,110 @@ +# From https://github.com/input-output-hk/plutus/blob/99f3a16cdf20e9e78a6105a097956a3773466b14/nix/dimension.nix +{ + /* dimension: name -> attrs -> function -> attrs + where + function: keyText -> value -> attrsOf package + + WARNING: Attribute names must not contain periods ("."). + See https://github.com/NixOS/nix/issues/3088 + + NOTE: The dimension name will be picked up by agent and web ui soon. + + Specifies a dimension of the build matrix. For example + + dimension "Example" { + withP = { p = true; } + withoutP = { p = false; } + } (key: # either "withP" or "withoutP" + { p }: # either p = true or p = false + myProject p + ) + + evaluates roughly to + + { + withP = myProject true; + withoutP = myProject false; + } + + Use nested calls for multiple dimensions. + + Example: + + dimension "System" { + "x86_64-linux" = {}; + # ... + }: (system: {}: + + dimension "Nixpkgs release" ( + { + "nixpkgs-19_03".nixpkgs = someSource + } // optionalAttrs (system != "...") { + "nixpkgs-unstable".nixpkgs = someOtherSource + } + ) (_key: { nixpkgs }: + + myProject system nixpkgs + + ) + ) + + evaluates roughly to + + { + x86_64-linux.nixpkgs-19_03 = myProject "x86_64-linux" someSource; + x86_64-linux.nixpkgs-unstable = myProject "x86_64-linux" someOtherSource; + ... + } + + If you need to make references across attributes, you can do so by binding + the result. Wherever you write + + dimension "My dimension" {} (key: value: f1 key value) + + You can also write + + let + myDimension = dimension "My dimension" {} (key: value: f2 key value myDimension) + in + myDimension + + This example builds a single test runner to reuse across releases: + + let + overlay = + testRunnerPkgs: self: super: { + # ... + }; + myProject = + { nixpkgs, + pkgs ? import nixpkgs { overlays = [ overlay ]; }, + testRunnerPkgs ? pkgs + }: pkgs; + in + + let + latest = "nixpkgs-19_03"; + releases = + dimension "Nixpkgs release" + { + nixpkgs-18_09.nixpkgs = someSource + nixpkgs-19_03.nixpkgs = someOtherSource + } + (_key: { nixpkgs }: + + myProject { + inherit nixpkgs; + testRunnerPkgs = releases."${latest}"; + } + + ); + in releases; + */ + dimension = name: attrs: f: + builtins.mapAttrs (k: v: + let o = f k v; + in o // { recurseForDerivations = o.recurseForDerivations or true; }) + attrs // { + meta.dimension.name = name; + }; +} diff --git a/nix/lib/fetch-github-lfs.nix b/nix/lib/fetch-github-lfs.nix new file mode 100644 index 0000000000..1b5596cd8a --- /dev/null +++ b/nix/lib/fetch-github-lfs.nix @@ -0,0 +1,107 @@ +{ lib, stdenvNoCC, runCommandLocal, cacert, curl, jq }: + +{ src +# `name` shouldn't use `baseNameOf` otherwise we'll +# get `is not allowed to refer to a store path` errors. +, name ? baseNameOf src, owner ? "urbit", repo ? "urbit" +, preferLocalBuild ? true }: + +assert builtins.isPath src; + +let + + # Parse the first 7 characters of the supplied `src` path for the required + # `version` key as defined by the lfs specification: + # https://github.com/git-lfs/git-lfs/blob/master/docs/spec.md + # + # If `version` exists we assume we're dealing with a lfs pointer and parse + # the `oid` and `size` from the pointer and write these into a JSON object. + # + # If the first 7 characters are unrecognised we assume the path is a binary + # file and set both `oid` and `size` to `null`. + # + # The `oid` and `size` are then JSON decoded into an expression to use + # as the fixed-output derivation's `sha256 = oid`, and to form a download + # operation payload to request the actual lfs blob's real url. + pointer = builtins.fromJSON (builtins.readFile + (runCommandLocal "lfs-pointer-${name}" { } '' + oid="null" + size="null" + + if [[ "$(head -c 7 "${src}")" != "version" ]]; then + header "lfs ${src} is a binary blob, skipping" + else + header "reading lfs pointer from ${src}" + + contents=($(awk '{print $2}' "${src}")) + oid="''${contents[1]#sha256:}" + size="''${contents[2]}" + fi + + cat < "$out" + {"oid": "$oid", "size": $size} + EOF + '')); + + downloadUrl = + "https://github.com/${owner}/${repo}.git/info/lfs/objects/batch"; + + # Encode `oid` and `size` into a download operation per: + # https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md + # + # This is done using toJSON to avoid bash quotation issuthe configurationes. + downloadPayload = builtins.toJSON { + operation = "download"; + objects = [ pointer ]; + }; + + # Define a fixed-output derivation using the lfs pointer's `oid` as the + # expected sha256 output hash, if `oid` is not null. + # + + # 1. Request the actual url of the binary file from the lfs batch api. + # 2. Download the binary file contents to `$out`. + download = stdenvNoCC.mkDerivation { + name = "lfs-blob-${name}"; + nativeBuildInputs = [ curl jq ]; + phases = [ "installPhase" ]; + installPhase = '' + curl=( + curl + --location + --max-redirs 20 + --retry 3 + --disable-epsv + --cookie-jar cookies + $NIX_CURL_FLAGS + ) + + header "reading lfs metadata from ${downloadUrl}" + + href=$("''${curl[@]}" \ + -d '${downloadPayload}' \ + -H 'Accept: application/vnd.git-lfs+json' \ + '${downloadUrl}' \ + | jq -r '.objects[0].actions.download.href') + + header "download lfs data from remote" + + # Pozor/Achtung: the href contains credential and signature information, + # so we avoid echoing it to stdout/err. + "''${curl[@]}" -s --output "$out" "$href" + ''; + + impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars; + + SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + + outputHashAlgo = "sha256"; + outputHashMode = "flat"; + outputHash = pointer.oid; + + inherit preferLocalBuild; + }; + + # If `pointer.oid` is null then supplied the `src` must be a binary + # blob and can be returned directly. +in if pointer.oid == null || pointer.size == null then src else download diff --git a/nix/lib/make-release-tarball.nix b/nix/lib/make-release-tarball.nix new file mode 100644 index 0000000000..3d77445ace --- /dev/null +++ b/nix/lib/make-release-tarball.nix @@ -0,0 +1,37 @@ +{ lib, stdenvNoCC, coreutils }: + +{ name, contents # { target = source, ... } +}: + +let + + transforms = builtins.concatStringsSep " " (lib.mapAttrsToList + (target: source: ''--transform "s,${source},${target},"'') contents); + + sources = builtins.concatStringsSep " " + (lib.mapAttrsToList (_target: source: "${source}") contents); + +in stdenvNoCC.mkDerivation { + name = "${name}.tar.gz"; + outputs = [ "out" "hash" ]; + nativeBuildInputs = [ coreutils ]; + phases = [ "buildPhase" "hashPhase" ]; + + buildPhase = '' + tar vczf $out \ + --owner=0 --group=0 --mode=u+rw,uga+r \ + --absolute-names \ + --hard-dereference \ + ${transforms} \ + ${sources} + ''; + + hashPhase = '' + mkdir $hash + + md5sum $out | awk '{printf $1}' > $hash/md5 + sha256sum $out | awk '{printf $1}' > $hash/sha256 + ''; + + preferLocalBuild = true; +} diff --git a/nix/lib/push-storage-object.nix b/nix/lib/push-storage-object.nix new file mode 100644 index 0000000000..f942265157 --- /dev/null +++ b/nix/lib/push-storage-object.nix @@ -0,0 +1,64 @@ +{ lib, stdenvNoCC, coreutils, google-cloud-sdk, xxd }: + +# Somewhat annoyingly due to needing to use Google Storage's Content-MD5 +# to ensure a fixed output derivation - we need an md5sum of the file to +# upload. This is in additional to any sha256sum you might want to actually +# name the object key under. + +{ bucket, object, name, file, md5, serviceAccountKey, preferLocalBuild ? true }: + +assert lib.asserts.assertMsg (builtins.isString serviceAccountKey) + "`serviceAccountKey` must contain the JSON contents of a service-account key"; + +let + + uri = "gs://${bucket}/${lib.removePrefix "/" object}"; + +in stdenvNoCC.mkDerivation { + name = "push-${lib.strings.sanitizeDerivationName name}"; + + nativeBuildInputs = [ coreutils google-cloud-sdk xxd ]; + + phases = [ "installPhase" ]; + + installPhase = '' + set -euo pipefail + + export HOME="." + + gcloud auth activate-service-account --key-file=- <<< '${serviceAccountKey}' + + local_md5=$(echo -n '${md5}' | xxd -r -p | base64) + remote_md5= + + stat_uri() { + header "retrieving md5 for ${uri}" + + remote_md5=$(gsutil stat '${uri}' \ + | sed -n -e '/Hash (md5):/{s/.*: *//p}' \ + | base64 -d \ + | xxd -p) + } + + if ! stat_uri; then + header "copying ${file} to ${uri}" + + gsutil cp '${file}' '${uri}' + + if ! stat_uri; then + echo "failed calculating remote uri md5" >&2 + exit 1 + fi + fi + + # This is the same format as md5sum (double space separator) and + # is used as the outputHash to ensure a fixed output derivation. + echo -n "$remote_md5 ${uri}" > $out + ''; + + outputHashAlgo = "sha256"; + outputHashMode = "flat"; + outputHash = builtins.hashString "sha256" "${md5} ${uri}"; + + inherit preferLocalBuild; +} diff --git a/nix/lib/test-fake-ship.nix b/nix/lib/test-fake-ship.nix new file mode 100644 index 0000000000..3b463c42f1 --- /dev/null +++ b/nix/lib/test-fake-ship.nix @@ -0,0 +1,104 @@ +{ stdenvNoCC, cacert }: + +{ urbit, herb, arvo ? null, pill, ship ? "bus" }: + +stdenvNoCC.mkDerivation { + name = "test-${ship}"; + + buildInputs = [ cacert urbit herb ]; + + phases = [ "buildPhase" "installPhase " ]; + + buildPhase = '' + set -xeuo pipefail + + if ! [ -f "$SSL_CERT_FILE" ]; then + header "$SSL_CERT_FILE doesn't exist" + exit 1 + fi + + ARVO=${if arvo == null then "" else arvo} + PILL=${pill} + SHIP=${ship} + + if [ -z "$ARVO" ]; then + urbit -d -F $SHIP -B $PILL ./pier 2> urbit-output + else + urbit -d -F $SHIP -A $ARVO -B $PILL ./pier 2> urbit-output + fi + + tail -f urbit-output >&2 & + tailproc=$! + + cleanup () { + if [ -e ./pier/.vere.lock ]; then + kill $(< ./pier/.vere.lock) || true + fi + + kill "$tailproc" || true + + set +x + } + + trap cleanup EXIT + + herb ./pier -p hood -d '+hood/mass' + + # Run the unit tests and then print scrollback + herb ./pier -d '~& ~ ~& %test-unit-start ~' + herb ./pier -d '####-test %/tests' + herb ./pier -d '~& ~ ~& %test-unit-end ~' + + # Start and run the test app + herb ./pier -p hood -d '+hood/start %test' + + herb ./pier -d '~& ~ ~& %test-agents-start ~' + herb ./pier -p test -d '%agents' + herb ./pier -d '~& ~ ~& %test-agents-end ~' + + herb ./pier -d '~& ~ ~& %test-generators-start ~' + herb ./pier -p test -d '%generators' + herb ./pier -d '~& ~ ~& %test-generators-end ~' + + herb ./pier -d '~& ~ ~& %test-marks-start ~' + herb ./pier -p test -d '%marks' + herb ./pier -d '~& ~ ~& %test-marks-end ~' + + # Compact the loom, comparing memory use before and after + herb ./pier -p hood -d '+hood/mass' + + herb ./pier -d '~& ~ ~& %pack-start ~' + herb ./pier -p hood -d '+hood/pack' + herb ./pier -d '~& ~ ~& %pack-end ~' + + herb ./pier -p hood -d '+hood/mass' + herb ./pier -p hood -d '+hood/exit' + + # Collect output + cp urbit-output test-output-unit + cp urbit-output test-output-agents + cp urbit-output test-output-generators + cp urbit-output test-output-marks + + rm urbit-output + + sed -i '0,/test-unit-start/d' test-output-unit + sed -i '/test-unit-end/,$d' test-output-unit + + sed -i '0,/test-agents-start/d' test-output-agents + sed -i '/test-agents-end/,$d' test-output-agents + + sed -i '0,/test-generators-start/d' test-output-generators + sed -i '/test-generators-end/,$d' test-output-generators + + sed -i '0,/test-marks-start/d' test-output-marks + sed -i '/test-marks-end/,$d' test-output-marks + ''; + + installPhase = '' + mkdir $out + cp -r test-output-* $out/ + ''; + + meta = { platforms = [ "x86_64-linux" ]; }; +} diff --git a/nix/nixcrpkgs.nix b/nix/nixcrpkgs.nix deleted file mode 100644 index c65bdc3d68..0000000000 --- a/nix/nixcrpkgs.nix +++ /dev/null @@ -1,12 +0,0 @@ -let - - nixpkgs = import ./nixpkgs.nix; - - osx_sdk = builtins.fetchurl { - sha256 = "89aa34dfe5bcbc7d53d3c55a84b35ac810ecfbcdd16a64c9667992b0c36c60c4"; - url = "https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.11.sdk.tar.xz"; - }; - -in - -import ./nixcrpkgs/top.nix { inherit osx_sdk nixpkgs; } diff --git a/nix/nixcrpkgs/.gitignore b/nix/nixcrpkgs/.gitignore deleted file mode 100644 index fed8256b10..0000000000 --- a/nix/nixcrpkgs/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/result* -/support/results -macos/MacOSX10.12.sdk.tar.xz -macos/MacOSX10.13.sdk.tar.xz diff --git a/nix/nixcrpkgs/LICENSE.nixpkgs b/nix/nixcrpkgs/LICENSE.nixpkgs deleted file mode 100644 index a632d6f58b..0000000000 --- a/nix/nixcrpkgs/LICENSE.nixpkgs +++ /dev/null @@ -1,31 +0,0 @@ -Copyright (c) 2003-2017 Eelco Dolstra and the Nixpkgs/NixOS contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -====================================================================== - -Note: the license above does not apply to the packages built by the -Nix Packages collection, merely to the package descriptions (i.e., Nix -expressions, build scripts, etc.). Also, the license does not apply -to some of the binaries used for bootstrapping Nixpkgs (e.g., -pkgs/stdenv/linux/tools/bash). It also might not apply to patches -included in Nixpkgs, which may be derivative works of the packages to -which they apply. The aforementioned artifacts are all covered by the -licenses of the respective packages. diff --git a/nix/nixcrpkgs/LICENSE.txt b/nix/nixcrpkgs/LICENSE.txt deleted file mode 100644 index 714d2d141b..0000000000 --- a/nix/nixcrpkgs/LICENSE.txt +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2017 Pololu Corporation. For more information, see - -http://www.pololu.com/ -http://forum.pololu.com/ - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/nix/nixcrpkgs/README.md b/nix/nixcrpkgs/README.md deleted file mode 100644 index 4e0f1f6f8d..0000000000 --- a/nix/nixcrpkgs/README.md +++ /dev/null @@ -1,175 +0,0 @@ -# nixcrpkgs - -[www.pololu.com](https://www.pololu.com/) - -*nixcrpkgs* is a collection of tools for cross-compiling statically-linked, -standalone software applications. With nixcrpkgs, you can specify what -platforms you want to target, what libraries and build tools you depend on, and -the commands that build your software. When you build your software, nixcrpkgs -will automatically take care of building or retrieving everything you need, -including cross-compilers and libraries. - -nixcrpkgs primarily consists of *Nix expressions*, which are recipes for -building software with [Nix, the purely functional package -manager][nix]. These recipes build on top of the [Nix -Packages collection (Nixpkgs)][nixpkgs]. - -## Features - -- Supported target platforms: - - Windows (32-bit or 64-bit) using [mingw-w64](https://mingw-w64.org/) and [GCC](https://gcc.gnu.org/) 6.3.0 - - Linux (32-bit, 64-bit, and ARM) using [musl](https://www.musl-libc.org/) and [GCC](https://gcc.gnu.org/) 6.3.0 - - macOS using [Clang](https://clang.llvm.org/) 5.0.0 -- Supported languages for cross-compiling: - - C - - C++ -- Supported build platforms: - - Linux -- Supported build tools: - - [CMake](https://cmake.org/) - - [GNU Make](https://www.gnu.org/software/make/) - - [Ninja](https://ninja-build.org/) - - pkg-config (as implemented by [pkgconf](https://github.com/pkgconf/pkgconf)) - - [GNU Bash](https://www.gnu.org/software/bash/) - - [Ruby](https://www.ruby-lang.org/) -- Notable supported libraries: - - [Qt](https://www.qt.io/) 5.9.6 - - [libusb](https://libusb.info/) - - [libusbp](https://github.com/pololu/libusbp) - - [Windows API](https://en.wikipedia.org/wiki/Windows_API) (thanks to mingw-w64) - - -## Getting started - -To get started, you should first install Nix on a Linux machine by following the -instructions on the [Nix website][nix]. - -Next, run `df -h` to make sure you have enough disk space. - -- The filesystem that holds `/nix` should have several gigabytes of free -space. Each GCC cross-compiler takes about 300 MB while each Qt installation -takes about 800 MB. -- The filesystem that holds `/tmp` should have at least 4 gigabytes of free -space, which will be needed while building cross-compilers. If that is not the -case on your system, you can set the `TMPDIR` environment variable to tell -`nix-build` to perform its builds in a different directory on a filesystem with -more free space. - -Next, clone or download this repository and use `cd` to change into the -top-level directory. - -To build a simple "Hello, World!" program for Windows, run: - - nix-build -A win32.hello - -The first time you run this command, it will take a while because Nix has to -build a cross-compiling toolchain. When `nix-build` is done, it will print the -name of a directory in `/nix/store` that holds the resulting program, and it -will create a symbolic link in the current directory named `result` that points -to that directory. - -If you copy `result/bin/hello.exe` to a Windows machine and run it, you should -see a message box appear that says "Hello, World!". - -If you run `nix-build -A win32.hello` a second time, Nix will detect that -nothing about the build recipes has changed, so it will simply print the -directory name and remake the symbolic link. - -To see how the `hello` package is specified in nixcrpkgs, you can look in -`pkgs.nix` and the `pkgs/hello` directory. To see how the GCC cross-compiler -for Windows was specified, you can look in the `mingw-w64` directory. If you -change any of the build recipes for `hello` or its dependencies and then run the -`nix-build` command again, Nix will automatically rebuild those dependencies and -anything that depends on them, ensuring that you always get a consistent build. - - -### Obtaining the macOS SDK - -If you are trying to build software for macOS, you will need to get a -macOS SDK tarball and put it in the the right place. Otherwise, you -will get an error like this: - - error: getting attributes of path '/home/yourname/nixcrpkgs/macos/MacOSX.sdk.tar.xz': No such file or directory - -To generate the tarball, follow these steps: - -1. On a macOS machine, install [Xcode](https://developer.apple.com/xcode/). -2. Download this repository to the machine. -3. In a Terminal window, run the `macos/gen_sdk_package.sh` script from this repository. -4. After several minutes, the current directory should have a tarball with a name like - `MacOSX10.12.sdk.tar.xz` and a size of about 25 MB. -5. Copy the SDK tarball file to the machine where you will be building software, - and put it in the `macos` directory. -6. The nixcrpkgs build recipe for the SDK is hardcoded to look for a file named - `MacOSX.sdk.tar.xz`, so rename the tarball to that. -7. Consider keeping a backup of the tarball so you can always rebuild any software you - made with it. - -Now you should be able to build your software for macOS. - - -## Integrating nixcrpkgs into your project - -The instructions above show how to cross-compile a "Hello, World!" program that -is included with nixcrpkgs. Instead of including your project in nixcrpkgs like -the hello program, you will probably want to just use nixcrpkgs as a tool in -your project. To get an idea of how to do that, you can look at other projects -that have done the same. In the projects listed below, you should look for a -file named `default.nix` in the top-level directory and look for build -instructions that explain what `nix-build` commands to run. - -* The [Pololu Tic Stepper Motor Controller software](https://github.com/pololu/pololu-tic-software) is a C/C++ project that uses CMake and nixcrpkgs. -* The [Pololu USB AVR Programmer v2 software](https://github.com/pololu/pololu-usb-avr-programmer-v2) is a C++ project that uses CMake and nixcrpkgs. -* The [Pololu USB Bootloader Utility (p-load)](https://github.com/pololu/p-load) is a C++ project that uses CMake and nixcrpkgs. - -[nix]: http://nixos.org/nix/ -[nixpkgs]: http://nixos.org/nixpkgs/ - -## Updating package versions - -Each build recipe in nixcrpkgs specifies a version number for the software that it builds. It is relatively easy to update the recipes even if you have not worked with Nix before. The general procedure is: - -1) Find the build recipe you want to update. For example, if you wanted to update the version of GCC used to build Linux programs, you would update the build recipe in `linux/gcc/default.nix`. -2) Find the part of the build recipe where the software sources are downloaded from the internet. It is usually a `fetchurl` command with two parameters: `url` and `sha256`. The `url` parameter usually refers to a version string defined nearby, so update that version string and/or the `url` parameter as desired. -3) In a shell, run `nix-prefetch-url URL`, where URL is the new URL specified in your modified build recipe with all version variables fully expanded). This command will download the URL you specified, store it in the Nix store, and output the hash of it in the proper format for Nix build recipes. -3) Update the `sha256` hash string in the build recipe by replacing it with the hash that was printed in the output of `nix-prefetch-url`. Updating the hash in the build recipe is important: Nix uses it to determine whether you already downloaded the right file, so if you don't update the hash then Nix might use the wrong file (e.g. an older version of the software that you downloaded earlier). -4) Run the usual `nix-build` command that you use to build your software. For example, you could go to the top-level directory of nixcrpkgs and run `nix-build -A rpi.hello` to build a "Hello world" program for the Raspberry Pi, or you could run `nix-build -A rpi.gcc` to just build the cross-compiler. -5) Fix any error messages that happen, one at a time. (Tip: to make a `.patch` file, run `diff -ur old new` where `old` and `new` are directories that contain the unpatched and patched versions of the source code, respectively.) -6) Once things are working, consider publishing your work on Github so others can benefit from what you figured out. - - -## Maintaining the nixcrpkgs system - -You should occasionally run `nix-collect-garbage` to remove items that are no -longer needed and reclaim your disk space. However, note that Nix will -typically remove all of your cross compilers and libraries when you run this -command, so be prepared to do a lengthy mass rebuild. The Nix manual has more -information about [Nix garbage -collection](http://nixos.org/nix/manual/#sec-garbage-collection). - -You should occasionally run `nix-channel --update` to update to the latest -version of Nixpkgs. However, when doing this, be aware that the new version of -Nixpkgs might require you to do a mass rebuild. - -You should occasionally update your checkout of the nixcrpkgs repository to get -the latest versions of build tools, new features, and bug fixes. Once again, -this might require a mass rebuild. - -If you want your builds to be very stable and reliable, you could make forks of -nixcrpkgs and/or Nixpkgs and update them at your own pace, carefully considering -any changes made by others before merging them in. That's one of the beauties -of Nix when compared to other package management systems: you will never be -forced to upgrade your build tools, and using old tools is just as easy as using -new ones. You can use the `NIX_PATH` environment variable to tell `nix-build` -to use your forked versions. - - -## Related projects - -* [osxcross]: Cross-compiling toolchain targeting macOS. -* [musl-cross-make]: Makefile-based build tool for creating cross-compilers targeting musl. -* [musl_nix_arm]: A fork of nixcrpkgs with a focus on building Docker images for ARM Linux. - -[osxcross]: https://github.com/tpoechtrager/osxcross -[musl-cross-make]: https://github.com/richfelker/musl-cross-make -[musl_nix_arm]: https://github.com/filleduchaos/musl_nix_arm diff --git a/nix/nixcrpkgs/bundle_builder.sh b/nix/nixcrpkgs/bundle_builder.sh deleted file mode 100644 index 9cb37fda5f..0000000000 --- a/nix/nixcrpkgs/bundle_builder.sh +++ /dev/null @@ -1,8 +0,0 @@ -source $setup -names=($names) -dirs=($dirs) -mkdir $out -cd $out -for ((i=0;i<${#names[@]};i++)); do - ln -s "${dirs[i]}" "${names[i]}" -done diff --git a/nix/nixcrpkgs/cmake_toolchain/builder.sh b/nix/nixcrpkgs/cmake_toolchain/builder.sh deleted file mode 100644 index 6d422fcc7b..0000000000 --- a/nix/nixcrpkgs/cmake_toolchain/builder.sh +++ /dev/null @@ -1,8 +0,0 @@ -source $stdenv/setup - -cat > $out < {}; - osx_sdk = ./macos/MacOSX.sdk.tar.xz; -} diff --git a/nix/nixcrpkgs/linux/README.md b/nix/nixcrpkgs/linux/README.md deleted file mode 100644 index 14a41d067e..0000000000 --- a/nix/nixcrpkgs/linux/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## Linux GCC toolchain - -The files in this directory define how we build our GCC cross-compiler that -targets Linux, using the musl libc. - -### A note about `-rdynamic` - -Do not pass `-rdynamic` to GCC when building an executable; it will cause the compiled executable to depend on a musl libc dynamic loader in `/lib` that probably doesn't exist, and defeats the point of static linking. The `-static` option overrides `-rdynamic`, so adding`-static` to the linker flags of a project using `-rdynamic` is one way to fix the issue. - -CMake will pass `-rdynamic` unless you set [CMP0065](https://cmake.org/cmake/help/v3.8/policy/CMP0065.html) to new as shown below, or set your [CMake policy version](https://cmake.org/cmake/help/v3.8/command/cmake_policy.html) to 3.4 or later. - - # Don't use -rdynamic since it causes Musl static linking to not work. - cmake_policy(SET CMP0065 NEW) - diff --git a/nix/nixcrpkgs/linux/binutils/builder.sh b/nix/nixcrpkgs/linux/binutils/builder.sh deleted file mode 100644 index 8795ea0ce1..0000000000 --- a/nix/nixcrpkgs/linux/binutils/builder.sh +++ /dev/null @@ -1,26 +0,0 @@ -source $stdenv/setup - -unset CC CXX CFLAGS LDFLAGS LD AR AS RANLIB SIZE STRINGS NM STRIP OBJCOPY - -tar -xf $src - -cd binutils-$version -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done - -# Clear the default library search path (noSysDirs) -echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt - -cd .. - -mkdir build -cd build - -../binutils-$version/configure --prefix=$out $configure_flags - -make - -make install - diff --git a/nix/nixcrpkgs/linux/binutils/default.nix b/nix/nixcrpkgs/linux/binutils/default.nix deleted file mode 100644 index 824b3d3955..0000000000 --- a/nix/nixcrpkgs/linux/binutils/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ native, host }: - -native.make_derivation rec { - name = "binutils-${version}-${host}"; - - version = "2.27"; - - src = native.nixpkgs.fetchurl { - url = "mirror://gnu/binutils/binutils-${version}.tar.bz2"; - sha256 = "125clslv17xh1sab74343fg6v31msavpmaa1c1394zsqa773g5rn"; - }; - - patches = [ - ./deterministic.patch - ]; - - native_inputs = [ native.nixpkgs.bison native.nixpkgs.zlib ]; - - configure_flags = - "--target=${host} " + - "--enable-shared " + - "--enable-deterministic-archives " + - "--disable-werror "; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/linux/binutils/deterministic.patch b/nix/nixcrpkgs/linux/binutils/deterministic.patch deleted file mode 100644 index 0a264b35c7..0000000000 --- a/nix/nixcrpkgs/linux/binutils/deterministic.patch +++ /dev/null @@ -1,12 +0,0 @@ -Make binutils output deterministic by default. ---- orig/ld/ldlang.c -+++ new/ld/ldlang.c -@@ -3095,6 +3095,8 @@ - ldfile_output_machine)) - einfo (_("%P%F:%s: can not set architecture: %E\n"), name); - -+ link_info.output_bfd->flags |= BFD_DETERMINISTIC_OUTPUT; -+ - link_info.hash = bfd_link_hash_table_create (link_info.output_bfd); - if (link_info.hash == NULL) - einfo (_("%P%F: can not create hash table: %E\n")); diff --git a/nix/nixcrpkgs/linux/default.nix b/nix/nixcrpkgs/linux/default.nix deleted file mode 100644 index 188cd02614..0000000000 --- a/nix/nixcrpkgs/linux/default.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ native, arch, gcc_options ? "" }: -let - nixpkgs = native.nixpkgs; - - host = "${arch}-linux-musleabi"; - - os = "linux"; - - compiler = "gcc"; - - exe_suffix = ""; - - binutils = import ./binutils { inherit native host; }; - - linux_arch = - if arch == "i686" || arch == "x86_64" then "x86" - else if arch == "armv6" || arch == "armv7" then "arm" - else throw "not sure what Linux architecture code to use"; - - headers = native.make_derivation rec { - name = "linux-headers-${linux_arch}-${version}"; - inherit linux_arch; - version = "4.4.10"; - src = nixpkgs.fetchurl { - url = "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "1kpjvvd9q9wwr3314q5ymvxii4dv2d27295bzly225wlc552xhja"; - }; - builder = ./headers_builder.sh; - }; - - gcc = import ./gcc { - inherit native host binutils headers gcc_options; - }; - - license = native.make_derivation { - name = "linux-license"; - inherit (gcc) musl_src gcc_src; - linux_src = headers.src; - builder = ./license_builder.sh; - }; - - global_license_set = { _global = license; }; - - cmake_toolchain = import ../cmake_toolchain { - cmake_system_name = "Linux"; - inherit nixpkgs host; - }; - - crossenv = { - is_cross = true; - - # Build tools available on the PATH for every derivation. - default_native_inputs = native.default_native_inputs ++ - [ gcc binutils native.pkgconf native.wrappers ]; - - # Target info environment variables. - inherit host arch os compiler exe_suffix; - - # CMake toolchain file. - inherit cmake_toolchain; - - # A wide variety of programs and build tools. - inherit nixpkgs; - - # Some native build tools made by nixcrpkgs. - inherit native; - - # License information that should be shipped with any software - # compiled by this environment. - inherit global_license_set; - - # Make it easy to refer to the build tools. - inherit headers gcc binutils; - - make_derivation = import ../make_derivation.nix crossenv; - }; -in - crossenv diff --git a/nix/nixcrpkgs/linux/gcc/builder.sh b/nix/nixcrpkgs/linux/gcc/builder.sh deleted file mode 100644 index f134826cc6..0000000000 --- a/nix/nixcrpkgs/linux/gcc/builder.sh +++ /dev/null @@ -1,34 +0,0 @@ -source $setup - -tar -xf $gcc_src -mv gcc-* gcc -cd gcc -for patch in $gcc_patches; do - echo applying patch $patch - patch -p1 -i $patch -done -cd .. - -tar -xf $musl_src -mv musl-* musl - -mkdir -p $out/$host -cp -r --no-preserve=mode $headers/include $out/$host - -mkdir build_gcc -cd build_gcc -../gcc/configure --prefix=$out $gcc_conf -cd .. -make -C build_gcc all-gcc -mkdir build_musl -cd build_musl -../musl/configure --prefix=$out/$host $musl_conf \ - CC="../build_gcc/gcc/xgcc -B ../build_gcc/gcc" \ - LIBCC=../build_gcc/$host/libgcc/libgcc.a -cd .. -make -C build_musl install-headers -make -C build_gcc all-target-libgcc -make -C build_musl -make -C build_musl install -make -C build_gcc -make -C build_gcc install diff --git a/nix/nixcrpkgs/linux/gcc/default.nix b/nix/nixcrpkgs/linux/gcc/default.nix deleted file mode 100644 index 8500cde1a4..0000000000 --- a/nix/nixcrpkgs/linux/gcc/default.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ native, host, binutils, headers, gcc_options }: - -let - nixpkgs = native.nixpkgs; - isl = nixpkgs.isl_0_14; - inherit (nixpkgs) stdenv lib fetchurl; - inherit (nixpkgs) gmp libmpc libelf mpfr zlib; -in - -native.make_derivation rec { - name = "gcc-${gcc_version}-${host}"; - - gcc_version = "6.3.0"; - gcc_src = fetchurl { - url = "mirror://gnu/gcc/gcc-${gcc_version}/gcc-${gcc_version}.tar.bz2"; - sha256 = "17xjz30jb65hcf714vn9gcxvrrji8j20xm7n33qg1ywhyzryfsph"; - }; - - musl_version = "1.1.16"; - musl_src = nixpkgs.fetchurl { - url = "https://www.musl-libc.org/releases/musl-${musl_version}.tar.gz"; - sha256 = "048h0w4yjyza4h05bkc6dpwg3hq6l03na46g0q1ha8fpwnjqawck"; - }; - - inherit host headers; - - builder = ./builder.sh; - - gcc_patches = [ - # These patches are from nixpkgs. - ./use-source-date-epoch.patch - ./libstdc++-target.patch - - # Without this, we cannot build a simple hello world program for ARM. - # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31798 - ./link_gcc_c_sequence_spec.patch - - # Fix a compiler error in GCC's ubsan.c: ISO C++ forbids comparison - # between pointer and integer. - ./ubsan.patch - ]; - - native_inputs = [ binutils ]; - - gcc_conf = - "--target=${host} " + - gcc_options + - "--with-gnu-as " + - "--with-gnu-ld " + - "--with-as=${binutils}/bin/${host}-as " + - "--with-ld=${binutils}/bin/${host}-ld " + - "--with-isl=${isl} " + - "--with-gmp-include=${gmp.dev}/include " + - "--with-gmp-lib=${gmp.out}/lib " + - "--with-libelf=${libelf}" + - "--with-mpfr=${mpfr.dev} " + - "--with-mpfr-include=${mpfr.dev}/include " + - "--with-mpfr-lib=${mpfr.out}/lib " + - "--with-mpc=${libmpc.out} " + - "--with-zlib-include=${zlib.dev}/include " + - "--with-zlib-lib=${zlib.out}/lib " + - "--enable-deterministic-archives " + - "--enable-languages=c,c++ " + - "--enable-libstdcxx-time " + - "--enable-static " + - "--enable-tls " + - "--disable-gnu-indirect-function " + - "--disable-libmudflap " + - "--disable-libmpx " + - "--disable-libsanitizer " + - "--disable-multilib " + - "--disable-shared " + - "--disable-werror"; - - musl_conf = - "--target=${host} " + - "--disable-shared"; - - hardeningDisable = [ "format" ]; -} - diff --git a/nix/nixcrpkgs/linux/gcc/libstdc++-target.patch b/nix/nixcrpkgs/linux/gcc/libstdc++-target.patch deleted file mode 100644 index fb622b3958..0000000000 --- a/nix/nixcrpkgs/linux/gcc/libstdc++-target.patch +++ /dev/null @@ -1,32 +0,0 @@ -Patch to make the target libraries 'configure' scripts find the proper CPP. -I noticed that building the mingw32 cross compiler. -Looking at the build script for mingw in archlinux, I think that only nixos -needs this patch. I don't know why. -diff --git a/Makefile.in b/Makefile.in -index 93f66b6..d691917 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -266,6 +266,7 @@ BASE_TARGET_EXPORTS = \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ -+ CPP="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ - CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ -@@ -291,11 +292,13 @@ BASE_TARGET_EXPORTS = \ - RAW_CXX_TARGET_EXPORTS = \ - $(BASE_TARGET_EXPORTS) \ - CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ -- CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; -+ CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \ -+ CXXCPP="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX; - - NORMAL_TARGET_EXPORTS = \ - $(BASE_TARGET_EXPORTS) \ -- CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; -+ CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \ -+ CXXCPP="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX; - - # Where to find GMP - HOST_GMPLIBS = @gmplibs@ diff --git a/nix/nixcrpkgs/linux/gcc/link_gcc_c_sequence_spec.patch b/nix/nixcrpkgs/linux/gcc/link_gcc_c_sequence_spec.patch deleted file mode 100644 index 5c976bcb85..0000000000 --- a/nix/nixcrpkgs/linux/gcc/link_gcc_c_sequence_spec.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur gcc-6.3.0-orig/gcc/config/gnu-user.h gcc-6.3.0/gcc/config/gnu-user.h ---- gcc-6.3.0-orig/gcc/config/gnu-user.h 2017-08-13 19:03:08.671572528 -0700 -+++ gcc-6.3.0/gcc/config/gnu-user.h 2017-08-13 19:15:00.768588499 -0700 -@@ -123,7 +123,7 @@ - - #undef LINK_GCC_C_SEQUENCE_SPEC - #define LINK_GCC_C_SEQUENCE_SPEC \ -- "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" -+ "--start-group %G %L --end-group" - - /* Use --as-needed -lgcc_s for eh support. */ - #ifdef HAVE_LD_AS_NEEDED diff --git a/nix/nixcrpkgs/linux/gcc/ubsan.patch b/nix/nixcrpkgs/linux/gcc/ubsan.patch deleted file mode 100644 index 0ad3b79912..0000000000 --- a/nix/nixcrpkgs/linux/gcc/ubsan.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- gcc-6.3.0-orig/gcc/ubsan.c -+++ gcc-6.3.0/gcc/ubsan.c -@@ -1471,7 +1471,7 @@ - - expanded_location xloc = expand_location (loc); - if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0 -- || xloc.file == '\0' || xloc.file[0] == '\xff' -+ || xloc.file == NULL || xloc.file[0] == '\xff' - || xloc.file[1] == '\xff') - return false; diff --git a/nix/nixcrpkgs/linux/gcc/use-source-date-epoch.patch b/nix/nixcrpkgs/linux/gcc/use-source-date-epoch.patch deleted file mode 100644 index 65a5ab028c..0000000000 --- a/nix/nixcrpkgs/linux/gcc/use-source-date-epoch.patch +++ /dev/null @@ -1,52 +0,0 @@ -https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02210.html - -diff --git a/libcpp/macro.c b/libcpp/macro.c -index 1e0a0b5..a52e3cb 100644 ---- a/libcpp/macro.c -+++ b/libcpp/macro.c -@@ -349,14 +349,38 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node) - slow on some systems. */ - time_t tt; - struct tm *tb = NULL; -+ char *source_date_epoch; - -- /* (time_t) -1 is a legitimate value for "number of seconds -- since the Epoch", so we have to do a little dance to -- distinguish that from a genuine error. */ -- errno = 0; -- tt = time(NULL); -- if (tt != (time_t)-1 || errno == 0) -- tb = localtime (&tt); -+ /* Allow the date and time to be set externally by an exported -+ environment variable to enable reproducible builds. */ -+ source_date_epoch = getenv ("SOURCE_DATE_EPOCH"); -+ if (source_date_epoch) -+ { -+ errno = 0; -+ tt = (time_t) strtol (source_date_epoch, NULL, 10); -+ if (errno == 0) -+ { -+ tb = gmtime (&tt); -+ if (tb == NULL) -+ cpp_error (pfile, CPP_DL_ERROR, -+ "SOURCE_DATE_EPOCH=\"%s\" is not a valid date", -+ source_date_epoch); -+ } -+ else -+ cpp_error (pfile, CPP_DL_ERROR, -+ "SOURCE_DATE_EPOCH=\"%s\" is not a valid number", -+ source_date_epoch); -+ } -+ else -+ { -+ /* (time_t) -1 is a legitimate value for "number of seconds -+ since the Epoch", so we have to do a little dance to -+ distinguish that from a genuine error. */ -+ errno = 0; -+ tt = time(NULL); -+ if (tt != (time_t)-1 || errno == 0) -+ tb = localtime (&tt); -+ } - - if (tb) - { diff --git a/nix/nixcrpkgs/linux/headers_builder.sh b/nix/nixcrpkgs/linux/headers_builder.sh deleted file mode 100644 index 9f4a5db09d..0000000000 --- a/nix/nixcrpkgs/linux/headers_builder.sh +++ /dev/null @@ -1,13 +0,0 @@ -source $setup -shopt -u nullglob - -tar -xf $src -mv linux-$version linux - -mkdir -p obj/staged -make -C linux headers_install \ - ARCH=$linux_arch \ - O=$(pwd)/obj \ - INSTALL_HDR_PATH=$out - -find $out '(' -name .install -o -name ..install.cmd ')' -exec rm {} + diff --git a/nix/nixcrpkgs/linux/license_builder.sh b/nix/nixcrpkgs/linux/license_builder.sh deleted file mode 100644 index 0a7d950738..0000000000 --- a/nix/nixcrpkgs/linux/license_builder.sh +++ /dev/null @@ -1,45 +0,0 @@ -source $setup - -tar -xf $gcc_src -mv gcc-* gcc - -tar -xf $musl_src -mv musl-* musl - -tar -xf $linux_src -mv linux-* linux - -license_gcc=$(cat gcc/COPYING3.LIB) -license_musl=$(cat musl/COPYRIGHT) -license_linux=$(cat linux/COPYING) - -cat > $out < - The third-party software included with this software may - have been patched or otherwise modified. -

- -

GCC run-time libraries

- -

- The GCC run-time libraries libgcc and libstdc++ are licensed under the GNU - General Public License Version 3 (GPLv3) as shown below. -

- -
-$license_gcc
-
- -

musl libc

- -
-$license_musl
-
- -

Linux headers

- -
-$license_linux
-
- -EOF diff --git a/nix/nixcrpkgs/macos/.gitignore b/nix/nixcrpkgs/macos/.gitignore deleted file mode 100644 index 40af159624..0000000000 --- a/nix/nixcrpkgs/macos/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/MacOSX.sdk.tar.xz diff --git a/nix/nixcrpkgs/macos/ar_builder.sh b/nix/nixcrpkgs/macos/ar_builder.sh deleted file mode 100644 index 14f1e438c7..0000000000 --- a/nix/nixcrpkgs/macos/ar_builder.sh +++ /dev/null @@ -1,46 +0,0 @@ -source $setup - -tar -xf $src -mv cctools-port-* cctools-port - -cd cctools-port - -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done - -# Similar to but not the same as the other _structs.h. -rm cctools/include/foreign/mach/i386/_structs.h - -# Causes a troublesome undefined reference. -rm cctools/libstuff/vm_flush_cache.c - -cd .. - -mv cctools-port/cctools/ar . -mv cctools-port/cctools/include . -mv cctools-port/cctools/libstuff . -rm -r cctools-port - -mkdir build -cd build - -CFLAGS="-Wno-deprecated -Wno-deprecated-declarations -Wno-unused-result -Werror -Wfatal-errors -O2 -g -I../include -I../include/foreign -DPROGRAM_PREFIX=\\\"$host-\\\" -D__LITTLE_ENDIAN__ -D__private_extern__= -D__DARWIN_UNIX03 -DPACKAGE_NAME=\\\"cctools\\\" -DPACKAGE_VERSION=\\\"$apple_version\\\" -DEMULATED_HOST_CPU_TYPE=16777223 -DEMULATED_HOST_CPU_SUBTYPE=3" - -CXXFLAGS="-std=gnu++11 $CFLAGS" - -LDFLAGS="-ldl -lpthread" - -for f in ../ar/*.c ../libstuff/*.c; do - echo "compiling $f" - eval "gcc -c $CFLAGS $f -o $(basename $f).o" -done - -gcc *.o $LDFLAGS -o $host-ar - -mkdir -p $out/bin -cp $host-ar $out/bin/ - -# ar looks for ranlib in this directory -ln -s $ranlib/bin/$host-ranlib $out/bin/ diff --git a/nix/nixcrpkgs/macos/cctools-bytesex.patch b/nix/nixcrpkgs/macos/cctools-bytesex.patch deleted file mode 100644 index 19ac3845f3..0000000000 --- a/nix/nixcrpkgs/macos/cctools-bytesex.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -ur cctools-port-c1cc758/cctools/include/stuff/bytesex.h cctools-port-bytesex/cctools/include/stuff/bytesex.h ---- cctools-port-c1cc758/cctools/include/stuff/bytesex.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-bytesex/cctools/include/stuff/bytesex.h 2017-11-10 19:07:26.338161875 -0800 -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - #include - #include - /* cctools-port: need to undef these to avoid warnings */ diff --git a/nix/nixcrpkgs/macos/cctools-format.patch b/nix/nixcrpkgs/macos/cctools-format.patch deleted file mode 100644 index f38ffe7efc..0000000000 --- a/nix/nixcrpkgs/macos/cctools-format.patch +++ /dev/null @@ -1,2661 +0,0 @@ -diff -ur cctools-port-c1cc758/cctools/ar/archive.h cctools-port-format/cctools/ar/archive.h ---- cctools-port-c1cc758/cctools/ar/archive.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ar/archive.h 2017-11-10 21:42:36.315713255 -0800 -@@ -112,11 +112,11 @@ - } CHDR; - - /* Header format strings. */ --#define HDR1 "%s%-13d%-12ld%-6u%-6u%-8o%-10qd%2s" --#define HDR2 "%-16.16s%-12ld%-6u%-6u%-8o%-10qd%2s" -+#define HDR1 "%s%-13d%-12ld%-6u%-6u%-8o%-10ld%2s" -+#define HDR2 "%-16.16s%-12ld%-6u%-6u%-8o%-10ld%2s" - - #define OLDARMAXNAME 15 --#define HDR3 "%-16.15s%-12ld%-6u%-6u%-8o%-10qd%2s" -+#define HDR3 "%-16.15s%-12ld%-6u%-6u%-8o%-10ld%2s" - - - #include -diff -ur cctools-port-c1cc758/cctools/ar/contents.c cctools-port-format/cctools/ar/contents.c ---- cctools-port-c1cc758/cctools/ar/contents.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ar/contents.c 2017-11-10 21:43:06.022707300 -0800 -@@ -107,7 +107,7 @@ - goto next; - if (options & AR_V) { - (void)strmode(chdr.mode, buf); -- (void)printf("%s %6d/%-6d %8qd ", -+ (void)printf("%s %6d/%-6d %8ld ", - buf + 1, chdr.uid, chdr.gid, chdr.size); - tp = localtime(&chdr.date); - (void)strftime(buf, sizeof(buf), "%b %e %H:%M %Y", tp); -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/debugline.c cctools-port-format/cctools/ld64/src/ld/debugline.c ---- cctools-port-c1cc758/cctools/ld64/src/ld/debugline.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/debugline.c 2017-11-10 19:13:05.914926185 -0800 -@@ -396,11 +396,11 @@ - case DW_LNE_set_address: - if (sz == 9) { - lnd->cur.pc = read_64 (eop); -- if (verbose) fprintf(stderr, "DW_LNE_set_address(0x%08llX)\n", lnd->cur.pc); -+ if (verbose) fprintf(stderr, "DW_LNE_set_address(0x%08lX)\n", lnd->cur.pc); - } - else if (sz == 5) { - lnd->cur.pc = read_32 (eop); -- if (verbose) fprintf(stderr, "DW_LNE_set_address(0x%08llX)\n", lnd->cur.pc); -+ if (verbose) fprintf(stderr, "DW_LNE_set_address(0x%08lX)\n", lnd->cur.pc); - } - else - return false; -@@ -442,11 +442,11 @@ - if (tmp == (uint64_t) -1) - return false; - lnd->cur.pc += tmp * lnd->minimum_instruction_length; -- if (verbose) fprintf(stderr, "DW_LNS_advance_pc(0x%08llX)\n", lnd->cur.pc); -+ if (verbose) fprintf(stderr, "DW_LNS_advance_pc(0x%08lX)\n", lnd->cur.pc); - break; - case DW_LNS_advance_line: - lnd->cur.line += read_sleb128 (lnd); -- if (verbose) fprintf(stderr, "DW_LNS_advance_line(%lld)\n", lnd->cur.line); -+ if (verbose) fprintf(stderr, "DW_LNS_advance_line(%ld)\n", lnd->cur.line); - break; - case DW_LNS_set_file: - if (verbose) fprintf(stderr, "DW_LNS_set_file\n"); -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/InputFiles.cpp cctools-port-format/cctools/ld64/src/ld/InputFiles.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/InputFiles.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/InputFiles.cpp 2017-11-10 19:13:05.914926185 -0800 -@@ -226,7 +226,7 @@ - if ( fd == -1 ) - throwf("can't open file, errno=%d", errno); - if ( info.fileLen < 20 ) -- throwf("file too small (length=%llu)", info.fileLen); -+ throwf("file too small (length=%lu)", info.fileLen); - - uint8_t* p = (uint8_t*)::mmap(NULL, info.fileLen, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0); - if ( p == (uint8_t*)(-1) ) -@@ -276,7 +276,7 @@ - newFileLen = statBuffer.st_size; - } - if ( fileOffset+len > newFileLen ) { -- throwf("truncated fat file. Slice from %u to %llu is past end of file with length %llu", -+ throwf("truncated fat file. Slice from %u to %lu is past end of file with length %lu", - fileOffset, fileOffset+len, info.fileLen); - } - } -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/ld.cpp cctools-port-format/cctools/ld64/src/ld/ld.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/ld.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/ld.cpp 2017-11-10 19:13:05.914926185 -0800 -@@ -1026,10 +1026,10 @@ - // sanity check size - if ( ((address + sect->size) > _options.maxAddress()) && (_options.outputKind() != Options::kObjectFile) - && (_options.outputKind() != Options::kStaticExecutable) ) -- throwf("section %s (address=0x%08llX, size=%llu) would make the output executable exceed available address range", -+ throwf("section %s (address=0x%08lX, size=%lu) would make the output executable exceed available address range", - sect->sectionName(), address, sect->size); - -- if ( log ) fprintf(stderr, " address=0x%08llX, hidden=%d, alignment=%02d, section=%s,%s\n", -+ if ( log ) fprintf(stderr, " address=0x%08lX, hidden=%d, alignment=%02d, section=%s,%s\n", - sect->address, sect->isSectionHidden(), sect->alignment, sect->segmentName(), sect->sectionName()); - // update running totals - if ( !sect->isSectionHidden() || hiddenSectionsOccupyAddressSpace ) -@@ -1060,7 +1060,7 @@ - address = ( (unalignedAddress+alignment-1) & (-alignment) ); - sect->alignmentPaddingBytes = (address - unalignedAddress); - sect->address = address; -- if ( log ) fprintf(stderr, " address=0x%08llX, hidden=%d, alignment=%02d, section=%s,%s\n", -+ if ( log ) fprintf(stderr, " address=0x%08lX, hidden=%d, alignment=%02d, section=%s,%s\n", - sect->address, sect->isSectionHidden(), sect->alignment, sect->segmentName(), sect->sectionName()); - // update running totals - if ( !sect->isSectionHidden() || hiddenSectionsOccupyAddressSpace ) -@@ -1119,7 +1119,7 @@ - // sanity check size - if ( ((address + sect->size) > _options.maxAddress()) && (_options.outputKind() != Options::kObjectFile) - && (_options.outputKind() != Options::kStaticExecutable) ) -- throwf("section %s (address=0x%08llX, size=%llu) would make the output executable exceed available address range", -+ throwf("section %s (address=0x%08lX, size=%lu) would make the output executable exceed available address range", - sect->sectionName(), address, sect->size); - - // sanity check it does not overlap a fixed address segment -@@ -1145,7 +1145,7 @@ - } - } - -- if ( log ) fprintf(stderr, " address=0x%08llX, size=0x%08llX, hidden=%d, alignment=%02d, padBytes=%d, section=%s,%s\n", -+ if ( log ) fprintf(stderr, " address=0x%08lX, size=0x%08lX, hidden=%d, alignment=%02d, padBytes=%d, section=%s,%s\n", - sect->address, sect->size, sect->isSectionHidden(), sect->alignment, sect->alignmentPaddingBytes, - sect->segmentName(), sect->sectionName()); - // update running totals -@@ -1159,7 +1159,7 @@ - ld::Internal::FinalSection* sect = *it; - //if ( sect->isSectionHidden() ) - // continue; -- fprintf(stderr, " address:0x%08llX, alignment:2^%d, size:0x%08llX, padBytes:%d, section:%s/%s\n", -+ fprintf(stderr, " address:0x%08lX, alignment:2^%d, size:0x%08lX, padBytes:%d, section:%s/%s\n", - sect->address, sect->alignment, sect->size, sect->alignmentPaddingBytes, - sect->segmentName(), sect->sectionName()); - -@@ -1200,7 +1200,7 @@ - fileOffset += sect->size; - } - -- if ( log ) fprintf(stderr, " fileoffset=0x%08llX, address=0x%08llX, hidden=%d, size=%lld, alignment=%02d, section=%s,%s\n", -+ if ( log ) fprintf(stderr, " fileoffset=0x%08lX, address=0x%08lX, hidden=%d, size=%ld, alignment=%02d, section=%s,%s\n", - sect->fileOffset, sect->address, sect->isSectionHidden(), sect->size, sect->alignment, - sect->segmentName(), sect->sectionName()); - } -@@ -1226,7 +1226,7 @@ - { - char* result = out; - char rawNum[30]; -- sprintf(rawNum, "%llu", in); -+ sprintf(rawNum, "%lu", in); - const int rawNumLen = strlen(rawNum); - for(int i=0; i < rawNumLen-1; ++i) { - *out++ = rawNum[i]; -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/LinkEdit.hpp cctools-port-format/cctools/ld64/src/ld/LinkEdit.hpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/LinkEdit.hpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/LinkEdit.hpp 2017-11-10 19:13:05.914926185 -0800 -@@ -324,39 +324,39 @@ - done = true; - break; - case REBASE_OPCODE_SET_TYPE_IMM: -- if ( log ) fprintf(stderr, "REBASE_OPCODE_SET_TYPE_IMM(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "REBASE_OPCODE_SET_TYPE_IMM(%ld)\n", it->operand1); - this->_encodedData.append_byte(REBASE_OPCODE_SET_TYPE_IMM | it->operand1); - break; - case REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: -- if ( log ) fprintf(stderr, "REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(%lld, 0x%llX)\n", it->operand1, it->operand2); -+ if ( log ) fprintf(stderr, "REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(%ld, 0x%lX)\n", it->operand1, it->operand2); - this->_encodedData.append_byte(REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB | it->operand1); - this->_encodedData.append_uleb128(it->operand2); - break; - case REBASE_OPCODE_ADD_ADDR_ULEB: -- if ( log ) fprintf(stderr, "REBASE_OPCODE_ADD_ADDR_ULEB(0x%llX)\n", it->operand1); -+ if ( log ) fprintf(stderr, "REBASE_OPCODE_ADD_ADDR_ULEB(0x%lX)\n", it->operand1); - this->_encodedData.append_byte(REBASE_OPCODE_ADD_ADDR_ULEB); - this->_encodedData.append_uleb128(it->operand1); - break; - case REBASE_OPCODE_ADD_ADDR_IMM_SCALED: -- if ( log ) fprintf(stderr, "REBASE_OPCODE_ADD_ADDR_IMM_SCALED(%lld=0x%llX)\n", it->operand1, it->operand1*sizeof(pint_t)); -+ if ( log ) fprintf(stderr, "REBASE_OPCODE_ADD_ADDR_IMM_SCALED(%ld=0x%lX)\n", it->operand1, it->operand1*sizeof(pint_t)); - this->_encodedData.append_byte(REBASE_OPCODE_ADD_ADDR_IMM_SCALED | it->operand1 ); - break; - case REBASE_OPCODE_DO_REBASE_IMM_TIMES: -- if ( log ) fprintf(stderr, "REBASE_OPCODE_DO_REBASE_IMM_TIMES(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "REBASE_OPCODE_DO_REBASE_IMM_TIMES(%ld)\n", it->operand1); - this->_encodedData.append_byte(REBASE_OPCODE_DO_REBASE_IMM_TIMES | it->operand1); - break; - case REBASE_OPCODE_DO_REBASE_ULEB_TIMES: -- if ( log ) fprintf(stderr, "REBASE_OPCODE_DO_REBASE_ULEB_TIMES(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "REBASE_OPCODE_DO_REBASE_ULEB_TIMES(%ld)\n", it->operand1); - this->_encodedData.append_byte(REBASE_OPCODE_DO_REBASE_ULEB_TIMES); - this->_encodedData.append_uleb128(it->operand1); - break; - case REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB: -- if ( log ) fprintf(stderr, "REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB(0x%llX)\n", it->operand1); -+ if ( log ) fprintf(stderr, "REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB(0x%lX)\n", it->operand1); - this->_encodedData.append_byte(REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB); - this->_encodedData.append_uleb128(it->operand1); - break; - case REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB: -- if ( log ) fprintf(stderr, "REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB(%lld, %lld)\n", it->operand1, it->operand2); -+ if ( log ) fprintf(stderr, "REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB(%ld, %ld)\n", it->operand1, it->operand2); - this->_encodedData.append_byte(REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB); - this->_encodedData.append_uleb128(it->operand1); - this->_encodedData.append_uleb128(it->operand2); -@@ -534,39 +534,39 @@ - done = true; - break; - case BIND_OPCODE_SET_DYLIB_ORDINAL_IMM: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_ORDINAL_IMM(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_ORDINAL_IMM(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_DYLIB_ORDINAL_IMM | it->operand1); - break; - case BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB); - this->_encodedData.append_uleb128(it->operand1); - break; - case BIND_OPCODE_SET_DYLIB_SPECIAL_IMM: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_SPECIAL_IMM(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_SPECIAL_IMM(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_DYLIB_SPECIAL_IMM | (it->operand1 & BIND_IMMEDIATE_MASK)); - break; - case BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM(0x%0llX, %s)\n", it->operand1, it->name); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM(0x%0lX, %s)\n", it->operand1, it->name); - this->_encodedData.append_byte(BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM | it->operand1); - this->_encodedData.append_string(it->name); - break; - case BIND_OPCODE_SET_TYPE_IMM: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_TYPE_IMM(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_TYPE_IMM(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_TYPE_IMM | it->operand1); - break; - case BIND_OPCODE_SET_ADDEND_SLEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_ADDEND_SLEB(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_ADDEND_SLEB(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_ADDEND_SLEB); - this->_encodedData.append_sleb128(it->operand1); - break; - case BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(%lld, 0x%llX)\n", it->operand1, it->operand2); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(%ld, 0x%lX)\n", it->operand1, it->operand2); - this->_encodedData.append_byte(BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB | it->operand1); - this->_encodedData.append_uleb128(it->operand2); - break; - case BIND_OPCODE_ADD_ADDR_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_ADD_ADDR_ULEB(0x%llX)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_ADD_ADDR_ULEB(0x%lX)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_ADD_ADDR_ULEB); - this->_encodedData.append_uleb128(it->operand1); - break; -@@ -575,16 +575,16 @@ - this->_encodedData.append_byte(BIND_OPCODE_DO_BIND); - break; - case BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB(0x%llX)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB(0x%lX)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB); - this->_encodedData.append_uleb128(it->operand1); - break; - case BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED: -- if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED(%lld=0x%llX)\n", it->operand1, it->operand1*sizeof(pint_t)); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED(%ld=0x%lX)\n", it->operand1, it->operand1*sizeof(pint_t)); - this->_encodedData.append_byte(BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED | it->operand1 ); - break; - case BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB(%lld, %lld)\n", it->operand1, it->operand2); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB(%ld, %ld)\n", it->operand1, it->operand2); - this->_encodedData.append_byte(BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB); - this->_encodedData.append_uleb128(it->operand1); - this->_encodedData.append_uleb128(it->operand2); -@@ -772,39 +772,39 @@ - done = true; - break; - case BIND_OPCODE_SET_DYLIB_ORDINAL_IMM: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_ORDINAL_IMM(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_ORDINAL_IMM(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_DYLIB_ORDINAL_IMM | it->operand1); - break; - case BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB); - this->_encodedData.append_uleb128(it->operand1); - break; - case BIND_OPCODE_SET_DYLIB_SPECIAL_IMM: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_SPECIAL_IMM(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_DYLIB_SPECIAL_IMM(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_DYLIB_SPECIAL_IMM | (it->operand1 & BIND_IMMEDIATE_MASK)); - break; - case BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM(0x%0llX, %s)\n", it->operand1, it->name); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM(0x%0lX, %s)\n", it->operand1, it->name); - this->_encodedData.append_byte(BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM | it->operand1); - this->_encodedData.append_string(it->name); - break; - case BIND_OPCODE_SET_TYPE_IMM: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_TYPE_IMM(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_TYPE_IMM(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_TYPE_IMM | it->operand1); - break; - case BIND_OPCODE_SET_ADDEND_SLEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_ADDEND_SLEB(%lld)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_ADDEND_SLEB(%ld)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_SET_ADDEND_SLEB); - this->_encodedData.append_sleb128(it->operand1); - break; - case BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(%lld, 0x%llX)\n", it->operand1, it->operand2); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(%ld, 0x%lX)\n", it->operand1, it->operand2); - this->_encodedData.append_byte(BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB | it->operand1); - this->_encodedData.append_uleb128(it->operand2); - break; - case BIND_OPCODE_ADD_ADDR_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_ADD_ADDR_ULEB(0x%llX)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_ADD_ADDR_ULEB(0x%lX)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_ADD_ADDR_ULEB); - this->_encodedData.append_uleb128(it->operand1); - break; -@@ -813,16 +813,16 @@ - this->_encodedData.append_byte(BIND_OPCODE_DO_BIND); - break; - case BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB(0x%llX)\n", it->operand1); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB(0x%lX)\n", it->operand1); - this->_encodedData.append_byte(BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB); - this->_encodedData.append_uleb128(it->operand1); - break; - case BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED: -- if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED(%lld=0x%llX)\n", it->operand1, it->operand1*sizeof(pint_t)); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED(%ld=0x%lX)\n", it->operand1, it->operand1*sizeof(pint_t)); - this->_encodedData.append_byte(BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED | it->operand1 ); - break; - case BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: -- if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB(%lld, %lld)\n", it->operand1, it->operand2); -+ if ( log ) fprintf(stderr, "BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB(%ld, %ld)\n", it->operand1, it->operand2); - this->_encodedData.append_byte(BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB); - this->_encodedData.append_uleb128(it->operand1); - this->_encodedData.append_uleb128(it->operand2); -@@ -1018,7 +1018,7 @@ - entry.importName = atom->name(); - } - entries.push_back(entry); -- //fprintf(stderr, "re-export %s from lib %llu as %s\n", entry.importName, entry.other, entry.name); -+ //fprintf(stderr, "re-export %s from lib %lu as %s\n", entry.importName, entry.other, entry.name); - } - else if ( atom->definition() == ld::Atom::definitionAbsolute ) { - entry.name = atom->name(); -@@ -1136,7 +1136,7 @@ - _64bitPointerLocations.push_back(address); - break; - default: -- warning("codegen at address 0x%08llX prevents image from working in dyld shared cache", address); -+ warning("codegen at address 0x%08lX prevents image from working in dyld shared cache", address); - break; - } - } -@@ -1152,7 +1152,7 @@ - _32bitPointerLocations.push_back(address); - break; - default: -- warning("codegen at address 0x%08llX prevents image from working in dyld shared cache", address); -+ warning("codegen at address 0x%08lX prevents image from working in dyld shared cache", address); - break; - } - } -@@ -1179,7 +1179,7 @@ - _thumbHi16Locations[extra].push_back(address); - break; - default: -- warning("codegen at address 0x%08llX prevents image from working in dyld shared cache", address); -+ warning("codegen at address 0x%08lX prevents image from working in dyld shared cache", address); - break; - } - } -@@ -1207,7 +1207,7 @@ - _64bitPointerLocations.push_back(address); - break; - default: -- warning("codegen at address 0x%08llX prevents image from working in dyld shared cache", address); -+ warning("codegen at address 0x%08lX prevents image from working in dyld shared cache", address); - break; - } - } -@@ -1219,9 +1219,9 @@ - pint_t addr = this->_options.baseAddress(); - for(typename std::vector::const_iterator it = locations.begin(); it != locations.end(); ++it) { - pint_t nextAddr = *it; -- //fprintf(stderr, "nextAddr=0x%0llX\n", (uint64_t)nextAddr); -+ //fprintf(stderr, "nextAddr=0x%0lX\n", (uint64_t)nextAddr); - uint64_t delta = nextAddr - addr; -- //fprintf(stderr, "delta=0x%0llX\n", delta); -+ //fprintf(stderr, "delta=0x%0lX\n", delta); - if ( delta == 0 ) - throw "double split seg info for same address"; - // uleb128 encode -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/Options.cpp cctools-port-format/cctools/ld64/src/ld/Options.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/Options.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/Options.cpp 2017-11-10 19:13:05.914926185 -0800 -@@ -2622,7 +2622,7 @@ - fBaseAddress = parseAddress(address); - uint64_t temp = ((fBaseAddress+fSegmentAlignment-1) & (-fSegmentAlignment)); - if ( fBaseAddress != temp ) { -- warning("-seg1addr not %lld byte aligned, rounding up", fSegmentAlignment); -+ warning("-seg1addr not %ld byte aligned, rounding up", fSegmentAlignment); - fBaseAddress = temp; - } - cannotBeUsedWithBitcode(arg); -@@ -2886,7 +2886,7 @@ - seg.address = parseAddress(argv[++i]); - uint64_t temp = ((seg.address+fSegmentAlignment-1) & (-fSegmentAlignment)); - if ( seg.address != temp ) -- warning("-segaddr %s not %lld byte aligned", seg.name, fSegmentAlignment); -+ warning("-segaddr %s not %ld byte aligned", seg.name, fSegmentAlignment); - fCustomSegmentAddresses.push_back(seg); - cannotBeUsedWithBitcode(arg); - } -@@ -4572,7 +4572,7 @@ - } - // range check -seg1addr for ARM - if ( fBaseAddress > fMaxAddress ) { -- warning("ignoring -seg1addr 0x%08llX. Address out of range.", fBaseAddress); -+ warning("ignoring -seg1addr 0x%08lX. Address out of range.", fBaseAddress); - fBaseAddress = 0; - } - break; -@@ -5207,7 +5207,7 @@ - // Make sure -image_base matches alignment - uint64_t alignedBaseAddress = (fBaseAddress+fSegmentAlignment-1) & (-fSegmentAlignment); - if ( alignedBaseAddress != fBaseAddress ) { -- warning("base address 0x%llX is not properly aligned. Changing it to 0x%llX", fBaseAddress, alignedBaseAddress); -+ warning("base address 0x%lX is not properly aligned. Changing it to 0x%lX", fBaseAddress, alignedBaseAddress); - fBaseAddress = alignedBaseAddress; - } - -@@ -5401,7 +5401,7 @@ - break; - } - if ( (fStackSize & (-fSegmentAlignment)) != fStackSize ) -- throwf("-stack_size must be multiple of segment alignment (%lldKB)", fSegmentAlignment/1024); -+ throwf("-stack_size must be multiple of segment alignment (%ldKB)", fSegmentAlignment/1024); - switch ( fOutputKind ) { - case Options::kDynamicExecutable: - case Options::kStaticExecutable: -@@ -5416,7 +5416,7 @@ - throw "-stack_size option can only be used when linking a main executable"; - } - if ( fStackSize > fStackAddr ) -- throwf("-stack_size (0x%08llX) must be smaller than -stack_addr (0x%08llX)", fStackSize, fStackAddr); -+ throwf("-stack_size (0x%08lX) must be smaller than -stack_addr (0x%08lX)", fStackSize, fStackAddr); - } - - // check that -allow_stack_execute is only used with main executables -@@ -5582,7 +5582,7 @@ - if ( fZeroPageSize != ULLONG_MAX ) { - for (std::vector::iterator it = fCustomSegmentAddresses.begin(); it != fCustomSegmentAddresses.end(); ++it) { - if ( it->address < fZeroPageSize ) -- throwf("-segaddr %s 0x%llX conflicts with -pagezero_size", it->name, it->address); -+ throwf("-segaddr %s 0x%lX conflicts with -pagezero_size", it->name, it->address); - } - } - // verify no duplicates -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/OutputFile.cpp cctools-port-format/cctools/ld64/src/ld/OutputFile.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/OutputFile.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/OutputFile.cpp 2017-11-10 19:13:05.918259550 -0800 -@@ -132,13 +132,13 @@ - { - fprintf(stderr, "SORTED:\n"); - for (std::vector::iterator it = state.sections.begin(); it != state.sections.end(); ++it) { -- fprintf(stderr, "final section %p %s/%s %s start addr=0x%08llX, size=0x%08llX, alignment=%02d, fileOffset=0x%08llX\n", -+ fprintf(stderr, "final section %p %s/%s %s start addr=0x%08lX, size=0x%08lX, alignment=%02d, fileOffset=0x%08lX\n", - (*it), (*it)->segmentName(), (*it)->sectionName(), (*it)->isSectionHidden() ? "(hidden)" : "", - (*it)->address, (*it)->size, (*it)->alignment, (*it)->fileOffset); - if ( printAtoms ) { - std::vector& atoms = (*it)->atoms; - for (std::vector::iterator ait = atoms.begin(); ait != atoms.end(); ++ait) { -- fprintf(stderr, " %p (0x%04llX) %s\n", *ait, (*ait)->size(), (*ait)->name()); -+ fprintf(stderr, " %p (0x%04lX) %s\n", *ait, (*ait)->size(), (*ait)->name()); - } - } - } -@@ -179,7 +179,7 @@ - ld::Internal::FinalSection* sect = *it; - if ( (segFirstSection == NULL ) || strcmp(segFirstSection->segmentName(), sect->segmentName()) != 0 ) { - if ( segFirstSection != NULL ) { -- //fprintf(stderr, "findSegment(0x%llX) seg changed to %s\n", addr, sect->segmentName()); -+ //fprintf(stderr, "findSegment(0x%lX) seg changed to %s\n", addr, sect->segmentName()); - if ( (addr >= segFirstSection->address) && (addr < lastSection->address+lastSection->size) ) { - *start = segFirstSection->address; - *end = lastSection->address+lastSection->size; -@@ -219,7 +219,7 @@ - break; - default: - (const_cast(atom))->setSectionStartAddress(sect->address); -- if ( log ) fprintf(stderr, " atom=%p, addr=0x%08llX, name=%s\n", atom, atom->finalAddress(), atom->name()); -+ if ( log ) fprintf(stderr, " atom=%p, addr=0x%08lX, name=%s\n", atom, atom->finalAddress(), atom->name()); - break; - } - } -@@ -435,7 +435,7 @@ - switch ( atom.symbolTableInclusion() ) { - case ld::Atom::symbolTableNotIn: - case ld::Atom::symbolTableNotInFinalLinkedImages: -- sprintf(buffer, "%s@0x%08llX", atom.name(), atom.objectAddress()); -+ sprintf(buffer, "%s@0x%08lX", atom.name(), atom.objectAddress()); - break; - case ld::Atom::symbolTableIn: - case ld::Atom::symbolTableInAndNeverStrip: -@@ -598,7 +598,7 @@ - for (std::vector::iterator it = state.sections.begin(); it != state.sections.end(); ++it) { - if ( (*it)->isSectionHidden() ) - continue; -- fprintf(stderr, " %s/%s addr=0x%08llX, size=0x%08llX, fileOffset=0x%08llX, type=%d\n", -+ fprintf(stderr, " %s/%s addr=0x%08lX, size=0x%08lX, fileOffset=0x%08lX, type=%d\n", - (*it)->segmentName(), (*it)->sectionName(), - (*it)->address, (*it)->size, (*it)->fileOffset, (*it)->type()); - } -@@ -612,7 +612,7 @@ - printSectionLayout(state); - - const ld::Atom* target; -- throwf("8-bit reference out of range (%lld max is +/-127B): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("8-bit reference out of range (%ld max is +/-127B): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -626,7 +626,7 @@ - printSectionLayout(state); - - const ld::Atom* target; -- throwf("16-bit reference out of range (%lld max is +/-32KB): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("16-bit reference out of range (%ld max is +/-32KB): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -640,7 +640,7 @@ - printSectionLayout(state); - - const ld::Atom* target; -- throwf("32-bit branch out of range (%lld max is +/-2GB): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("32-bit branch out of range (%ld max is +/-2GB): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -659,7 +659,7 @@ - if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) { - // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload or -static - if ( (_options.outputKind() != Options::kPreload) && (_options.outputKind() != Options::kStaticExecutable) ) { -- warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX", -+ warning("32-bit absolute address out of range (0x%08lX max is 4GB): from %s + 0x%08X (0x%08lX) to 0x%08lX", - displacement, atom->name(), fixup->offsetInAtom, atom->finalAddress(), displacement); - } - return; -@@ -669,10 +669,10 @@ - - const ld::Atom* target; - if ( fixup->binding == ld::Fixup::bindingNone ) -- throwf("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX", -+ throwf("32-bit absolute address out of range (0x%08lX max is 4GB): from %s + 0x%08X (0x%08lX) to 0x%08lX", - displacement, atom->name(), fixup->offsetInAtom, atom->finalAddress(), displacement); - else -- throwf("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to %s (0x%08llX)", -+ throwf("32-bit absolute address out of range (0x%08lX max is 4GB): from %s + 0x%08X (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), fixup->offsetInAtom, atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -687,7 +687,7 @@ - printSectionLayout(state); - - const ld::Atom* target; -- throwf("32-bit RIP relative reference out of range (%lld max is +/-4GB): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("32-bit RIP relative reference out of range (%ld max is +/-4GB): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -700,7 +700,7 @@ - printSectionLayout(state); - - const ld::Atom* target; -- throwf("ARM ldr 12-bit displacement out of range (%lld max is +/-4096B): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("ARM ldr 12-bit displacement out of range (%ld max is +/-4096B): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -720,7 +720,7 @@ - printSectionLayout(state); - - const ld::Atom* target; -- throwf("b/bl/blx ARM branch out of range (%lld max is +/-32MB): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("b/bl/blx ARM branch out of range (%ld max is +/-32MB): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -752,12 +752,12 @@ - - const ld::Atom* target; - if ( _options.preferSubArchitecture() && _options.archSupportsThumb2() ) { -- throwf("b/bl/blx thumb2 branch out of range (%lld max is +/-16MB): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("b/bl/blx thumb2 branch out of range (%ld max is +/-16MB): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } - else { -- throwf("b/bl/blx thumb1 branch out of range (%lld max is +/-4MB): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("b/bl/blx thumb1 branch out of range (%ld max is +/-4MB): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -772,7 +772,7 @@ - printSectionLayout(state); - - const ld::Atom* target; -- throwf("b(l) ARM64 branch out of range (%lld max is +/-128MB): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("b(l) ARM64 branch out of range (%ld max is +/-128MB): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -786,7 +786,7 @@ - printSectionLayout(state); - - const ld::Atom* target; -- throwf("ARM64 ADRP out of range (%lld max is +/-4GB): from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("ARM64 ADRP out of range (%ld max is +/-4GB): from %s (0x%08lX) to %s (0x%08lX)", - displacement, atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fixup), - addressOf(state, fixup, &target)); - } -@@ -1871,7 +1871,7 @@ - uint32_t nextDisp = (j1 << 13) | (j2 << 11) | imm11; - uint32_t firstDisp = (s << 10) | imm10; - newInstruction = instruction | (nextDisp << 16) | firstDisp; -- //warning("s=%d, j1=%d, j2=%d, imm10=0x%0X, imm11=0x%0X, instruction=0x%08X, first=0x%04X, next=0x%04X, new=0x%08X, disp=0x%llX for %s to %s\n", -+ //warning("s=%d, j1=%d, j2=%d, imm10=0x%0X, imm11=0x%0X, instruction=0x%08X, first=0x%04X, next=0x%04X, new=0x%08X, disp=0x%lX for %s to %s\n", - // s, j1, j2, imm10, imm11, instruction, firstDisp, nextDisp, newInstruction, delta, atom->name(), toTarget->name()); - set32LE(fixUpLocation, newInstruction); - } -@@ -2003,7 +2003,7 @@ - // vector and byte LDR/STR have same "size" bits, need to check other bits to differenciate - implictShift = 4; - if ( (offset & 0xF) != 0 ) { -- throwf("128-bit LDR/STR not 16-byte aligned: from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("128-bit LDR/STR not 16-byte aligned: from %s (0x%08lX) to %s (0x%08lX)", - atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fit), - addressOf(state, fit, &toTarget)); - } -@@ -2011,21 +2011,21 @@ - break; - case 1: - if ( (offset & 0x1) != 0 ) { -- throwf("16-bit LDR/STR not 2-byte aligned: from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("16-bit LDR/STR not 2-byte aligned: from %s (0x%08lX) to %s (0x%08lX)", - atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fit), - addressOf(state, fit, &toTarget)); - } - break; - case 2: - if ( (offset & 0x3) != 0 ) { -- throwf("32-bit LDR/STR not 4-byte aligned: from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("32-bit LDR/STR not 4-byte aligned: from %s (0x%08lX) to %s (0x%08lX)", - atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fit), - addressOf(state, fit, &toTarget)); - } - break; - case 3: - if ( (offset & 0x7) != 0 ) { -- throwf("64-bit LDR/STR not 8-byte aligned: from %s (0x%08llX) to %s (0x%08llX)", -+ throwf("64-bit LDR/STR not 8-byte aligned: from %s (0x%08lX) to %s (0x%08lX)", - atom->name(), atom->finalAddress(), referenceTargetAtomName(state, fit), - addressOf(state, fit, &toTarget)); - } -@@ -2177,11 +2177,11 @@ - set32LE(infoA.instructionContent, makeNOP()); - set32LE(infoB.instructionContent, makeLDR_literal(ldrInfoB, infoA.targetAddress, infoB.instructionAddress)); - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-ldr at 0x%08llX transformed to LDR literal, usableSegment=%d usableSegment\n", infoB.instructionAddress, usableSegment); -+ fprintf(stderr, "adrp-ldr at 0x%08lX transformed to LDR literal, usableSegment=%d usableSegment\n", infoB.instructionAddress, usableSegment); - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-ldr at 0x%08llX not transformed, isLDR=%d, literalableSize=%d, inRange=%d, usableSegment=%d, scaledOffset=%d\n", -+ fprintf(stderr, "adrp-ldr at 0x%08lX not transformed, isLDR=%d, literalableSize=%d, inRange=%d, usableSegment=%d, scaledOffset=%d\n", - infoB.instructionAddress, isLDR, literalableSize, withinOneMeg(infoB.instructionAddress, infoA.targetAddress), usableSegment, ldrInfoB.offset); - } - break; -@@ -2208,7 +2208,7 @@ - set32LE(infoB.instructionContent, makeNOP()); - set32LE(infoC.instructionContent, makeLDR_literal(ldrInfoC, infoA.targetAddress+ldrInfoC.offset, infoC.instructionAddress)); - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-add-ldr at 0x%08llX T1 transformed to LDR literal\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-add-ldr at 0x%08lX T1 transformed to LDR literal\n", infoC.instructionAddress); - } - } - else if ( usableSegment && withinOneMeg(infoA.instructionAddress, infoA.targetAddress+ldrInfoC.offset) ) { -@@ -2219,7 +2219,7 @@ - set32LE(infoC.instructionContent, makeLoadOrStore(ldrInfoC)); - set32LE(infoC.instructionContent, infoC.instruction & 0xFFC003FF); - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-add-ldr at 0x%08llX T4 transformed to ADR/LDR\n", infoB.instructionAddress); -+ fprintf(stderr, "adrp-add-ldr at 0x%08lX T4 transformed to ADR/LDR\n", infoB.instructionAddress); - } - else if ( ((infoB.targetAddress % ldrInfoC.size) == 0) && (ldrInfoC.offset == 0) ) { - // can do T2 transformation by merging ADD into LD -@@ -2228,11 +2228,11 @@ - ldrInfoC.offset += addInfoB.addend; - set32LE(infoC.instructionContent, makeLoadOrStore(ldrInfoC)); - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-add-ldr at 0x%08llX T2 transformed to ADRP/LDR \n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-add-ldr at 0x%08lX T2 transformed to ADRP/LDR \n", infoC.instructionAddress); - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-add-ldr at 0x%08llX could not be transformed, loadSize=%d, literalableSize=%d, inRange=%d, usableSegment=%d, targetFourByteAligned=%d, imm12=%d\n", -+ fprintf(stderr, "adrp-add-ldr at 0x%08lX could not be transformed, loadSize=%d, literalableSize=%d, inRange=%d, usableSegment=%d, targetFourByteAligned=%d, imm12=%d\n", - infoC.instructionAddress, ldrInfoC.size, literalableSize, withinOneMeg(infoC.instructionAddress, infoA.targetAddress+ldrInfoC.offset), usableSegment, targetFourByteAligned, ldrInfoC.offset); - } - break; -@@ -2252,11 +2252,11 @@ - set32LE(infoA.instructionContent, makeADR(addInfoB.destReg, infoA.targetAddress, infoA.instructionAddress)); - set32LE(infoB.instructionContent, makeNOP()); - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-add at 0x%08llX transformed to ADR\n", infoB.instructionAddress); -+ fprintf(stderr, "adrp-add at 0x%08lX transformed to ADR\n", infoB.instructionAddress); - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-add at 0x%08llX not transformed, isAdd=%d, inRange=%d, usableSegment=%d\n", -+ fprintf(stderr, "adrp-add at 0x%08lX not transformed, isAdd=%d, inRange=%d, usableSegment=%d\n", - infoB.instructionAddress, isADD, withinOneMeg(infoA.targetAddress, infoA.instructionAddress), usableSegment); - } - break; -@@ -2278,19 +2278,19 @@ - LOH_ASSERT(ldrInfoB.size == 8); - LOH_ASSERT(!ldrInfoB.isFloat); - LOH_ASSERT(ldrInfoC.baseReg == ldrInfoB.reg); -- //fprintf(stderr, "infoA.target=%p, %s, infoA.targetAddress=0x%08llX\n", infoA.target, infoA.target->name(), infoA.targetAddress); -+ //fprintf(stderr, "infoA.target=%p, %s, infoA.targetAddress=0x%08lX\n", infoA.target, infoA.target->name(), infoA.targetAddress); - targetFourByteAligned = ( ((infoA.targetAddress + ldrInfoC.offset) & 0x3) == 0 ); - if ( usableSegment && targetFourByteAligned && withinOneMeg(infoB.instructionAddress, infoA.targetAddress + ldrInfoC.offset) ) { - // can do T5 transform - set32LE(infoA.instructionContent, makeNOP()); - set32LE(infoB.instructionContent, makeLDR_literal(ldrInfoB, infoA.targetAddress, infoB.instructionAddress)); - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got-ldr at 0x%08llX T5 transformed to LDR literal of GOT plus LDR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-ldr at 0x%08lX T5 transformed to LDR literal of GOT plus LDR\n", infoC.instructionAddress); - } - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-ldr-got-ldr at 0x%08llX no optimization done\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-ldr at 0x%08lX no optimization done\n", infoC.instructionAddress); - } - } - else if ( isADD ) { -@@ -2305,7 +2305,7 @@ - set32LE(infoB.instructionContent, makeNOP()); - set32LE(infoC.instructionContent, makeLDR_literal(ldrInfoC, infoA.targetAddress + ldrInfoC.offset, infoC.instructionAddress)); - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-ldr-got-ldr at 0x%08llX T1 transformed to LDR literal\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-ldr at 0x%08lX T1 transformed to LDR literal\n", infoC.instructionAddress); - } - else if ( usableSegment && withinOneMeg(infoA.instructionAddress, infoA.targetAddress) ) { - // can do T4 transform -@@ -2313,7 +2313,7 @@ - set32LE(infoB.instructionContent, makeNOP()); - set32LE(infoC.instructionContent, makeLoadOrStore(ldrInfoC)); - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got-ldr at 0x%08llX T4 transformed to ADR/LDR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-ldr at 0x%08lX T4 transformed to ADR/LDR\n", infoC.instructionAddress); - } - } - else if ( ((infoA.targetAddress % ldrInfoC.size) == 0) && ((addInfoB.addend + ldrInfoC.offset) < 4096) ) { -@@ -2323,19 +2323,19 @@ - ldrInfoC.offset += addInfoB.addend; - set32LE(infoC.instructionContent, makeLoadOrStore(ldrInfoC)); - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got-ldr at 0x%08llX T2 transformed to ADRP/NOP/LDR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-ldr at 0x%08lX T2 transformed to ADRP/NOP/LDR\n", infoC.instructionAddress); - } - } - else { - // T3 transform already done by ld::passes:got:doPass() - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got-ldr at 0x%08llX T3 transformed to ADRP/ADD/LDR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-ldr at 0x%08lX T3 transformed to ADRP/ADD/LDR\n", infoC.instructionAddress); - } - } - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-ldr-got-ldr at 0x%08llX not ADD or LDR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-ldr at 0x%08lX not ADD or LDR\n", infoC.instructionAddress); - } - break; - case LOH_ARM64_ADRP_ADD_STR: -@@ -2361,7 +2361,7 @@ - set32LE(infoC.instructionContent, makeLoadOrStore(ldrInfoC)); - set32LE(infoC.instructionContent, infoC.instruction & 0xFFC003FF); - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-add-str at 0x%08llX T4 transformed to ADR/STR\n", infoB.instructionAddress); -+ fprintf(stderr, "adrp-add-str at 0x%08lX T4 transformed to ADR/STR\n", infoB.instructionAddress); - } - else if ( ((infoB.targetAddress % ldrInfoC.size) == 0) && (ldrInfoC.offset == 0) ) { - // can do T2 transformation by merging ADD into STR -@@ -2370,11 +2370,11 @@ - ldrInfoC.offset += addInfoB.addend; - set32LE(infoC.instructionContent, makeLoadOrStore(ldrInfoC)); - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-add-str at 0x%08llX T2 transformed to ADRP/STR \n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-add-str at 0x%08lX T2 transformed to ADRP/STR \n", infoC.instructionAddress); - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-add-str at 0x%08llX could not be transformed, loadSize=%d, inRange=%d, usableSegment=%d, imm12=%d\n", -+ fprintf(stderr, "adrp-add-str at 0x%08lX could not be transformed, loadSize=%d, inRange=%d, usableSegment=%d, imm12=%d\n", - infoC.instructionAddress, ldrInfoC.size, withinOneMeg(infoC.instructionAddress, infoA.targetAddress+ldrInfoC.offset), usableSegment, ldrInfoC.offset); - } - break; -@@ -2402,12 +2402,12 @@ - set32LE(infoA.instructionContent, makeNOP()); - set32LE(infoB.instructionContent, makeLDR_literal(ldrInfoB, infoA.targetAddress, infoB.instructionAddress)); - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got-str at 0x%08llX T5 transformed to LDR literal of GOT plus STR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-str at 0x%08lX T5 transformed to LDR literal of GOT plus STR\n", infoC.instructionAddress); - } - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-ldr-got-str at 0x%08llX no optimization done\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-str at 0x%08lX no optimization done\n", infoC.instructionAddress); - } - } - else if ( isADD ) { -@@ -2422,7 +2422,7 @@ - set32LE(infoB.instructionContent, makeNOP()); - set32LE(infoC.instructionContent, makeLoadOrStore(ldrInfoC)); - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got-str at 0x%08llX T4 transformed to ADR/STR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-str at 0x%08lX T4 transformed to ADR/STR\n", infoC.instructionAddress); - } - } - else if ( ((infoA.targetAddress % ldrInfoC.size) == 0) && (ldrInfoC.offset == 0) ) { -@@ -2432,19 +2432,19 @@ - ldrInfoC.offset += addInfoB.addend; - set32LE(infoC.instructionContent, makeLoadOrStore(ldrInfoC)); - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got-str at 0x%08llX T4 transformed to ADRP/NOP/STR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-str at 0x%08lX T4 transformed to ADRP/NOP/STR\n", infoC.instructionAddress); - } - } - else { - // T3 transform already done by ld::passes:got:doPass() - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got-str at 0x%08llX T3 transformed to ADRP/ADD/STR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-str at 0x%08lX T3 transformed to ADRP/ADD/STR\n", infoC.instructionAddress); - } - } - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-ldr-got-str at 0x%08llX not ADD or LDR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got-str at 0x%08lX not ADD or LDR\n", infoC.instructionAddress); - } - break; - case LOH_ARM64_ADRP_LDR_GOT: -@@ -2463,7 +2463,7 @@ - set32LE(infoA.instructionContent, makeNOP()); - set32LE(infoB.instructionContent, makeLDR_literal(ldrInfoB, infoA.targetAddress, infoB.instructionAddress)); - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got at 0x%08llX T5 transformed to NOP/LDR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got at 0x%08lX T5 transformed to NOP/LDR\n", infoC.instructionAddress); - } - } - } -@@ -2473,23 +2473,23 @@ - set32LE(infoA.instructionContent, makeADR(addInfoB.destReg, infoA.targetAddress, infoA.instructionAddress)); - set32LE(infoB.instructionContent, makeNOP()); - if ( _options.verboseOptimizationHints() ) { -- fprintf(stderr, "adrp-ldr-got at 0x%08llX T4 transformed to ADR/STR\n", infoC.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got at 0x%08lX T4 transformed to ADR/STR\n", infoC.instructionAddress); - } - } - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-ldr-got at 0x%08llX not LDR or ADD\n", infoB.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got at 0x%08lX not LDR or ADD\n", infoB.instructionAddress); - } - } - else { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "adrp-ldr-got at 0x%08llX not ADRP\n", infoA.instructionAddress); -+ fprintf(stderr, "adrp-ldr-got at 0x%08lX not ADRP\n", infoA.instructionAddress); - } - break; - default: - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "unknown hint kind %d alt.info.kind at 0x%08llX\n", alt.info.kind, infoA.instructionAddress); -+ fprintf(stderr, "unknown hint kind %d alt.info.kind at 0x%08lX\n", alt.info.kind, infoA.instructionAddress); - break; - } - } -@@ -2511,13 +2511,13 @@ - LOH_ASSERT(isPageKind(infoB.fixup)); - if ( (infoA.instruction & 0x9F000000) != 0x90000000 ) { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "may-reused-adrp at 0x%08llX no longer an ADRP, now 0x%08X\n", infoA.instructionAddress, infoA.instruction); -+ fprintf(stderr, "may-reused-adrp at 0x%08lX no longer an ADRP, now 0x%08X\n", infoA.instructionAddress, infoA.instruction); - sAdrpNA++; - break; - } - if ( (infoB.instruction & 0x9F000000) != 0x90000000 ) { - if ( _options.verboseOptimizationHints() ) -- fprintf(stderr, "may-reused-adrp at 0x%08llX no longer an ADRP, now 0x%08X\n", infoB.instructionAddress, infoA.instruction); -+ fprintf(stderr, "may-reused-adrp at 0x%08lX no longer an ADRP, now 0x%08X\n", infoB.instructionAddress, infoA.instruction); - sAdrpNA++; - break; - } -@@ -2607,7 +2607,7 @@ - if ( takesNoDiskSpace(sect) ) - continue; - const bool sectionUsesNops = (sect->type() == ld::Section::typeCode); -- //fprintf(stderr, "file offset=0x%08llX, section %s\n", sect->fileOffset, sect->sectionName()); -+ //fprintf(stderr, "file offset=0x%08lX, section %s\n", sect->fileOffset, sect->sectionName()); - std::vector& atoms = sect->atoms; - bool lastAtomWasThumb = false; - for (std::vector::iterator ait = atoms.begin(); ait != atoms.end(); ++ait) { -@@ -2662,11 +2662,11 @@ - // the bitcode section should also be excluded in the UUID computation. - // Bitcode section should appears before LINKEDIT - // Exclude section cmd -- if ( log ) fprintf(stderr, "bundle cmd start=0x%08llX, bundle cmd end=0x%08llX\n", -+ if ( log ) fprintf(stderr, "bundle cmd start=0x%08lX, bundle cmd end=0x%08lX\n", - bitcodeCmdOffset, bitcodeCmdEnd); - excludeRegions.emplace_back(std::pair(bitcodeCmdOffset, bitcodeCmdEnd)); - // Exclude section content -- if ( log ) fprintf(stderr, "bundle start=0x%08llX, bundle end=0x%08llX\n", -+ if ( log ) fprintf(stderr, "bundle start=0x%08lX, bundle end=0x%08lX\n", - bitcodeSectOffset, bitcodePaddingEnd); - excludeRegions.emplace_back(std::pair(bitcodeSectOffset, bitcodePaddingEnd)); - } -@@ -2691,8 +2691,8 @@ - uint64_t lastStabNlistFileOffset = symbolTableFileOffset + stabsOffsetEnd; - uint64_t firstStabStringFileOffset = stringPoolFileOffset + stabsStringsOffsetStart; - uint64_t lastStabStringFileOffset = stringPoolFileOffset + tabsStringsOffsetEnd; -- if ( log ) fprintf(stderr, "stabNlist offset=0x%08llX, size=0x%08llX\n", firstStabNlistFileOffset, lastStabNlistFileOffset-firstStabNlistFileOffset); -- if ( log ) fprintf(stderr, "stabString offset=0x%08llX, size=0x%08llX\n", firstStabStringFileOffset, lastStabStringFileOffset-firstStabStringFileOffset); -+ if ( log ) fprintf(stderr, "stabNlist offset=0x%08lX, size=0x%08lX\n", firstStabNlistFileOffset, lastStabNlistFileOffset-firstStabNlistFileOffset); -+ if ( log ) fprintf(stderr, "stabString offset=0x%08lX, size=0x%08lX\n", firstStabStringFileOffset, lastStabStringFileOffset-firstStabStringFileOffset); - assert(firstStabNlistFileOffset <= firstStabStringFileOffset); - excludeRegions.emplace_back(std::pair(firstStabNlistFileOffset, lastStabNlistFileOffset)); - excludeRegions.emplace_back(std::pair(firstStabStringFileOffset, lastStabStringFileOffset)); -@@ -2701,12 +2701,12 @@ - uint64_t linkeditSegCmdSize; - _headersAndLoadCommandAtom->linkeditCmdInfo(linkeditSegCmdOffset, linkeditSegCmdSize); - excludeRegions.emplace_back(std::pair(linkeditSegCmdOffset, linkeditSegCmdOffset+linkeditSegCmdSize)); -- if ( log ) fprintf(stderr, "linkedit SegCmdOffset=0x%08llX, size=0x%08llX\n", linkeditSegCmdOffset, linkeditSegCmdSize); -+ if ( log ) fprintf(stderr, "linkedit SegCmdOffset=0x%08lX, size=0x%08lX\n", linkeditSegCmdOffset, linkeditSegCmdSize); - uint64_t symbolTableCmdOffset; - uint64_t symbolTableCmdSize; - _headersAndLoadCommandAtom->symbolTableCmdInfo(symbolTableCmdOffset, symbolTableCmdSize); - excludeRegions.emplace_back(std::pair(symbolTableCmdOffset, symbolTableCmdOffset+symbolTableCmdSize)); -- if ( log ) fprintf(stderr, "linkedit SegCmdOffset=0x%08llX, size=0x%08llX\n", symbolTableCmdOffset, symbolTableCmdSize); -+ if ( log ) fprintf(stderr, "linkedit SegCmdOffset=0x%08lX, size=0x%08lX\n", symbolTableCmdOffset, symbolTableCmdSize); - } - if ( !excludeRegions.empty() ) { - CC_MD5_CTX md5state; -@@ -2722,11 +2722,11 @@ - uint64_t regionStart = region.first; - uint64_t regionEnd = region.second; - assert(checksumStart <= regionStart && regionStart <= regionEnd && "Region overlapped"); -- if ( log ) fprintf(stderr, "checksum 0x%08llX -> 0x%08llX\n", checksumStart, regionStart); -+ if ( log ) fprintf(stderr, "checksum 0x%08lX -> 0x%08lX\n", checksumStart, regionStart); - CC_MD5_Update(&md5state, &wholeBuffer[checksumStart], regionStart - checksumStart); - checksumStart = regionEnd; - } -- if ( log ) fprintf(stderr, "checksum 0x%08llX -> 0x%08llX\n", checksumStart, _fileSize); -+ if ( log ) fprintf(stderr, "checksum 0x%08lX -> 0x%08lX\n", checksumStart, _fileSize); - CC_MD5_Update(&md5state, &wholeBuffer[checksumStart], _fileSize-checksumStart); - CC_MD5_Final(digest, &md5state); - if ( log ) fprintf(stderr, "uuid=%02X, %02X, %02X, %02X, %02X, %02X, %02X, %02X\n", digest[0], digest[1], digest[2], -@@ -2857,7 +2857,7 @@ - - wholeBuffer = (uint8_t *)mmap(NULL, _fileSize, PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0); - if ( wholeBuffer == MAP_FAILED ) -- throwf("can't create buffer of %llu bytes for output", _fileSize); -+ throwf("can't create buffer of %lu bytes for output", _fileSize); - } - else { - if ( outputIsRegularFile ) -@@ -2869,7 +2869,7 @@ - // try to allocate buffer for entire output file content - wholeBuffer = (uint8_t*)calloc(_fileSize, 1); - if ( wholeBuffer == NULL ) -- throwf("can't create buffer of %llu bytes for output", _fileSize); -+ throwf("can't create buffer of %lu bytes for output", _fileSize); - } - - if ( _options.UUIDMode() == Options::kUUIDRandom ) { -@@ -4284,7 +4284,7 @@ - uint64_t sctEnd = (sct->address+sct->size); - if ( (sct->address <= targetAddress) && (targetAddress < sctEnd) ) { - if ( (targetAddress+checkAddend) > sctEnd ) { -- warning("data symbol %s from %s has pointer to %s + 0x%08llX. " -+ warning("data symbol %s from %s has pointer to %s + 0x%08lX. " - "That large of an addend may disable %s from being put in the dyld shared cache.", - atom->name(), atom->file()->path(), target->name(), addend, _options.installPath() ); - } -@@ -4728,7 +4728,7 @@ - if ( sect->isSectionHidden() ) - continue; - bool codeSection = (sect->type() == ld::Section::typeCode); -- if (log) fprintf(stderr, "sect: %s, address=0x%llX\n", sect->sectionName(), sect->address); -+ if (log) fprintf(stderr, "sect: %s, address=0x%lX\n", sect->sectionName(), sect->address); - for (std::vector::iterator ait = sect->atoms.begin(); ait != sect->atoms.end(); ++ait) { - const ld::Atom* atom = *ait; - const ld::Atom* target = NULL; -@@ -4887,7 +4887,7 @@ - if ( !hadSubtract && addend ) - toOffset += addend; - assert(toSectionIndex != 255); -- if (log) fprintf(stderr, "from (%d.%s + 0x%llX) to (%d.%s + 0x%llX), kind=%d, atomAddr=0x%llX, sectAddr=0x%llx\n", -+ if (log) fprintf(stderr, "from (%d.%s + 0x%lX) to (%d.%s + 0x%lX), kind=%d, atomAddr=0x%lX, sectAddr=0x%lx\n", - fromSectionIndex, sect->sectionName(), fromOffset, toSectionIndex, state.atomToSection[target]->sectionName(), - toOffset, kind, atom->finalAddress(), sect->address); - _splitSegV2Infos.push_back(SplitSegInfoV2Entry(fromSectionIndex, fromOffset, toSectionIndex, toOffset, kind)); -@@ -4961,7 +4961,7 @@ - ld::Internal::FinalSection* sect = *sit; - if ( sect->isSectionHidden() ) - continue; -- fprintf(mapFile, "0x%08llX\t0x%08llX\t%s\t%s\n", sect->address, sect->size, -+ fprintf(mapFile, "0x%08lX\t0x%08lX\t%s\t%s\n", sect->address, sect->size, - sect->segmentName(), sect->sectionName()); - } - // write table of symbols -@@ -5026,7 +5026,7 @@ - } - name = buffer; - } -- fprintf(mapFile, "0x%08llX\t0x%08llX\t[%3u] %s\n", atom->finalAddress(), atom->size(), -+ fprintf(mapFile, "0x%08lX\t0x%08lX\t[%3u] %s\n", atom->finalAddress(), atom->size(), - readerToFileOrdinal[atom->originalFile()], name); - } - } -@@ -5060,7 +5060,7 @@ - buffer[4095] = '\0'; - name = buffer; - } -- fprintf(mapFile, "<> \t0x%08llX\t[%3u] %s\n", atom->size(), -+ fprintf(mapFile, "<> \t0x%08lX\t[%3u] %s\n", atom->size(), - readerToFileOrdinal[atom->originalFile()], name); - } - } -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/parsers/archive_file.cpp cctools-port-format/cctools/ld64/src/ld/parsers/archive_file.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/parsers/archive_file.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/parsers/archive_file.cpp 2017-11-10 19:13:05.918259550 -0800 -@@ -601,7 +601,7 @@ - const char* entryName = &_tableOfContentStrings[E::get32(entry->ran_un.ran_strx)]; - uint64_t offset = E::get32(entry->ran_off); - if ( offset > _archiveFilelength ) { -- throwf("malformed archive TOC entry for %s, offset %d is beyond end of file %lld\n", -+ throwf("malformed archive TOC entry for %s, offset %d is beyond end of file %ld\n", - entryName, entry->ran_off, _archiveFilelength); - } - -@@ -622,11 +622,11 @@ - const char* entryName = &_tableOfContentStrings[E::get64(entry->ran_un.ran_strx)]; - uint64_t offset = E::get64(entry->ran_off); - if ( offset > _archiveFilelength ) { -- throwf("malformed archive TOC entry for %s, offset %lld is beyond end of file %lld\n", -+ throwf("malformed archive TOC entry for %s, offset %ld is beyond end of file %ld\n", - entryName, entry->ran_off, _archiveFilelength); - } - -- //fprintf(stderr, "adding hash %d: %s -> 0x%0llX\n", i, entryName, offset); -+ //fprintf(stderr, "adding hash %d: %s -> 0x%0lX\n", i, entryName, offset); - _hashTable[entryName] = offset; - } - } -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/parsers/libunwind/DwarfInstructions.hpp cctools-port-format/cctools/ld64/src/ld/parsers/libunwind/DwarfInstructions.hpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/parsers/libunwind/DwarfInstructions.hpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/parsers/libunwind/DwarfInstructions.hpp 2017-11-10 19:13:05.918259550 -0800 -@@ -245,7 +245,7 @@ - pint_t offsetOfFunctionAddress = p-currentCFI; - pint_t pcStart = addressSpace.getEncodedP(p, nextCFI, cieInfo.pointerEncoding); - pint_t pcRange = addressSpace.getEncodedP(p, nextCFI, cieInfo.pointerEncoding & 0x0F); -- //fprintf(stderr, "FDE with pcRange [0x%08llX, 0x%08llX)\n",(uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); -+ //fprintf(stderr, "FDE with pcRange [0x%08lX, 0x%08lX)\n",(uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); - entry->u.fdeInfo.function.targetAddress = pcStart; - entry->u.fdeInfo.function.offsetInCFI = offsetOfFunctionAddress; - entry->u.fdeInfo.function.encodingOfTargetAddress = cieInfo.pointerEncoding; -@@ -429,7 +429,7 @@ - template - int DwarfInstructions::stepWithDwarf(A& addressSpace, pint_t pc, pint_t fdeStart, R& registers) - { -- //fprintf(stderr, "stepWithDwarf(pc=0x%0llX, fdeStart=0x%0llX)\n", (uint64_t)pc, (uint64_t)fdeStart); -+ //fprintf(stderr, "stepWithDwarf(pc=0x%0lX, fdeStart=0x%0lX)\n", (uint64_t)pc, (uint64_t)fdeStart); - typename CFI_Parser::FDE_Info fdeInfo; - typename CFI_Parser::CIE_Info cieInfo; - if ( CFI_Parser::decodeFDE(addressSpace, fdeStart, &fdeInfo, &cieInfo) == NULL ) { -@@ -483,7 +483,7 @@ - pint_t expressionEnd = expression+20; // just need something until length is read - uint64_t length = addressSpace.getULEB128(p, expressionEnd); - expressionEnd = p + length; -- if (log) fprintf(stderr, "evaluateExpression(): length=%llu\n", length); -+ if (log) fprintf(stderr, "evaluateExpression(): length=%lu\n", length); - pint_t stack[100]; - pint_t* sp = stack; - *(++sp) = initialStackValue; -@@ -491,7 +491,7 @@ - while ( p < expressionEnd ) { - if (log) { - for(pint_t* t = sp; t > stack; --t) { -- fprintf(stderr, "sp[] = 0x%llX\n", (uint64_t)(*t)); -+ fprintf(stderr, "sp[] = 0x%lX\n", (uint64_t)(*t)); - } - } - uint8_t opcode = addressSpace.get8(p++); -@@ -504,14 +504,14 @@ - value = addressSpace.getP(p); - p += sizeof(pint_t); - *(++sp) = value; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_deref: - // pop stack, dereference, push result - value = *sp--; - *(++sp) = addressSpace.getP(value); -- if (log) fprintf(stderr, "dereference 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "dereference 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_const1u: -@@ -519,7 +519,7 @@ - value = addressSpace.get8(p); - p += 1; - *(++sp) = value; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_const1s: -@@ -527,7 +527,7 @@ - svalue = (int8_t)addressSpace.get8(p); - p += 1; - *(++sp) = svalue; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)svalue); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)svalue); - break; - - case DW_OP_const2u: -@@ -535,7 +535,7 @@ - value = addressSpace.get16(p); - p += 2; - *(++sp) = value; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_const2s: -@@ -543,7 +543,7 @@ - svalue = (int16_t)addressSpace.get16(p); - p += 2; - *(++sp) = svalue; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)svalue); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)svalue); - break; - - case DW_OP_const4u: -@@ -551,7 +551,7 @@ - value = addressSpace.get32(p); - p += 4; - *(++sp) = value; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_const4s: -@@ -559,7 +559,7 @@ - svalue = (int32_t)addressSpace.get32(p); - p += 4; - *(++sp) = svalue; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)svalue); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)svalue); - break; - - case DW_OP_const8u: -@@ -567,7 +567,7 @@ - value = addressSpace.get64(p); - p += 8; - *(++sp) = value; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_const8s: -@@ -575,21 +575,21 @@ - value = (int32_t)addressSpace.get64(p); - p += 8; - *(++sp) = value; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_constu: - // push immediate ULEB128 value - value = addressSpace.getULEB128(p, expressionEnd); - *(++sp) = value; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_consts: - // push immediate SLEB128 value - svalue = addressSpace.getSLEB128(p, expressionEnd); - *(++sp) = svalue; -- if (log) fprintf(stderr, "push 0x%llX\n", (uint64_t)svalue); -+ if (log) fprintf(stderr, "push 0x%lX\n", (uint64_t)svalue); - break; - - case DW_OP_dup: -@@ -642,7 +642,7 @@ - // pop stack, dereference, push result - value = *sp--; - *sp = *((uint64_t*)value); -- if (log) fprintf(stderr, "x-dereference 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "x-dereference 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_abs: -@@ -740,7 +740,7 @@ - svalue = (int16_t)addressSpace.get16(p); - p += 2; - p += svalue; -- if (log) fprintf(stderr, "skip %lld\n", (uint64_t)svalue); -+ if (log) fprintf(stderr, "skip %ld\n", (uint64_t)svalue); - break; - - case DW_OP_bra: -@@ -748,7 +748,7 @@ - p += 2; - if ( *sp-- ) - p += svalue; -- if (log) fprintf(stderr, "bra %lld\n", (uint64_t)svalue); -+ if (log) fprintf(stderr, "bra %ld\n", (uint64_t)svalue); - break; - - case DW_OP_eq: -@@ -821,7 +821,7 @@ - case DW_OP_lit31: - value = opcode - DW_OP_lit0; - *(++sp) = value; -- if (log) fprintf(stderr, "push literal 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "push literal 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_reg0: -@@ -864,7 +864,7 @@ - case DW_OP_regx: - reg = addressSpace.getULEB128(p, expressionEnd); - *(++sp) = registers.getRegister(reg); -- if (log) fprintf(stderr, "push reg %d + 0x%llX\n", reg, (uint64_t)svalue); -+ if (log) fprintf(stderr, "push reg %d + 0x%lX\n", reg, (uint64_t)svalue); - break; - - case DW_OP_breg0: -@@ -902,14 +902,14 @@ - reg = opcode - DW_OP_breg0; - svalue = addressSpace.getSLEB128(p, expressionEnd); - *(++sp) = registers.getRegister(reg) + svalue; -- if (log) fprintf(stderr, "push reg %d + 0x%llX\n", reg, (uint64_t)svalue); -+ if (log) fprintf(stderr, "push reg %d + 0x%lX\n", reg, (uint64_t)svalue); - break; - - case DW_OP_bregx: - reg = addressSpace.getULEB128(p, expressionEnd); - svalue = addressSpace.getSLEB128(p, expressionEnd); - *(++sp) = registers.getRegister(reg) + svalue; -- if (log) fprintf(stderr, "push reg %d + 0x%llX\n", reg, (uint64_t)svalue); -+ if (log) fprintf(stderr, "push reg %d + 0x%lX\n", reg, (uint64_t)svalue); - break; - - case DW_OP_fbreg: -@@ -940,7 +940,7 @@ - ABORT("DW_OP_deref_size with bad size"); - } - *(++sp) = value; -- if (log) fprintf(stderr, "sized dereference 0x%llX\n", (uint64_t)value); -+ if (log) fprintf(stderr, "sized dereference 0x%lX\n", (uint64_t)value); - break; - - case DW_OP_xderef_size: -@@ -954,7 +954,7 @@ - } - - } -- if (log) fprintf(stderr, "expression evaluates to 0x%llX\n", (uint64_t)*sp); -+ if (log) fprintf(stderr, "expression evaluates to 0x%lX\n", (uint64_t)*sp); - return *sp; - } - -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/parsers/libunwind/DwarfParser.hpp cctools-port-format/cctools/ld64/src/ld/parsers/libunwind/DwarfParser.hpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/parsers/libunwind/DwarfParser.hpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/parsers/libunwind/DwarfParser.hpp 2017-11-10 19:13:05.918259550 -0800 -@@ -212,12 +212,12 @@ - template - bool CFI_Parser::findFDE(A& addressSpace, pint_t pc, pint_t ehSectionStart, uint32_t sectionLength, pint_t fdeHint, FDE_Info* fdeInfo, CIE_Info* cieInfo) - { -- //fprintf(stderr, "findFDE(0x%llX)\n", (long long)pc); -+ //fprintf(stderr, "findFDE(0x%lX)\n", (long long)pc); - pint_t p = (fdeHint != 0) ? fdeHint : ehSectionStart; - const pint_t ehSectionEnd = p + sectionLength; - while ( p < ehSectionEnd ) { - pint_t currentCFI = p; -- //fprintf(stderr, "findFDE() CFI at 0x%llX\n", (long long)p); -+ //fprintf(stderr, "findFDE() CFI at 0x%lX\n", (long long)p); - uint64_t cfiLength = addressSpace.get32(p); - p += 4; - if ( cfiLength == 0xffffffff ) { -@@ -244,7 +244,7 @@ - // parse pc begin and range - pint_t pcStart = addressSpace.getEncodedP(p, nextCFI, cieInfo->pointerEncoding); - pint_t pcRange = addressSpace.getEncodedP(p, nextCFI, cieInfo->pointerEncoding & 0x0F); -- //fprintf(stderr, "FDE with pcRange [0x%08llX, 0x%08llX)\n",(uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); -+ //fprintf(stderr, "FDE with pcRange [0x%08lX, 0x%08lX)\n",(uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); - // test if pc is within the function this FDE covers - if ( (pcStart < pc) && (pc <= pcStart+pcRange) ) { - // parse rest of info -@@ -269,11 +269,11 @@ - fdeInfo->fdeInstructions = p; - fdeInfo->pcStart = pcStart; - fdeInfo->pcEnd = pcStart+pcRange; -- //fprintf(stderr, "findFDE(pc=0x%llX) found with pcRange [0x%08llX, 0x%08llX)\n",(uint64_t)pc, (uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); -+ //fprintf(stderr, "findFDE(pc=0x%lX) found with pcRange [0x%08lX, 0x%08lX)\n",(uint64_t)pc, (uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); - return true; - } - else { -- //fprintf(stderr, "findFDE(pc=0x%llX) not found with pcRange [0x%08llX, 0x%08llX)\n",(uint64_t)pc, (uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); -+ //fprintf(stderr, "findFDE(pc=0x%lX) not found with pcRange [0x%08lX, 0x%08lX)\n",(uint64_t)pc, (uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); - // pc is not in begin/range, skip this FDE - } - } -@@ -284,13 +284,13 @@ - } - else { - // malformed FDE. CIE is bad -- //fprintf(stderr, "malformed FDE, cieStart=0x%llX, ehSectionStart=0x%llX, ehSectionEnd=0x%llX\n", -+ //fprintf(stderr, "malformed FDE, cieStart=0x%lX, ehSectionStart=0x%lX, ehSectionEnd=0x%lX\n", - // (uint64_t)cieStart, (uint64_t)ehSectionStart, (uint64_t)ehSectionEnd); - } - p = nextCFI; - } - } -- //fprintf(stderr, "findFDE(pc=0x%llX) not found\n",(uint64_t)pc); -+ //fprintf(stderr, "findFDE(pc=0x%lX) not found\n",(uint64_t)pc); - return false; - } - -@@ -302,7 +302,7 @@ - template - const char* CFI_Parser::parseCIE(A& addressSpace, pint_t cie, CIE_Info* cieInfo) - { -- //fprintf(stderr, "parseCIE(0x%llX)\n", (long long)cie); -+ //fprintf(stderr, "parseCIE(0x%lX)\n", (long long)cie); - cieInfo->pointerEncoding = 0; - cieInfo->lsdaEncoding = 0; - cieInfo->personalityEncoding = 0; -@@ -463,7 +463,7 @@ - pint_t offsetOfFunctionAddress = p-currentCFI; - pint_t pcStart = addressSpace.getEncodedP(p, nextCFI, cieInfo.pointerEncoding); - pint_t pcRange = addressSpace.getEncodedP(p, nextCFI, cieInfo.pointerEncoding & 0x0F); -- //fprintf(stderr, "FDE with pcRange [0x%08llX, 0x%08llX)\n",(uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); -+ //fprintf(stderr, "FDE with pcRange [0x%08lX, 0x%08lX)\n",(uint64_t)pcStart, (uint64_t)(pcStart+pcRange)); - // test if pc is within the function this FDE covers - entry.function.address = pcStart; - entry.function.offsetInFDE = offsetOfFunctionAddress; -@@ -518,7 +518,7 @@ - pint_t p = instructions; - uint32_t codeOffset = 0; - PrologInfo initialState = *results; -- if ( logDwarf ) fprintf(stderr, "parseInstructions(instructions=0x%0llX)\n", (uint64_t)instructionsEnd); -+ if ( logDwarf ) fprintf(stderr, "parseInstructions(instructions=0x%0lX)\n", (uint64_t)instructionsEnd); - - // see Dwarf Spec, section 6.4.2 for details on unwind opcodes - while ( (p < instructionsEnd) && (codeOffset < pcoffset) ) { -@@ -564,7 +564,7 @@ - results->registerSavedMoreThanOnce = true; - results->savedRegisters[reg].location = kRegisterInCFA; - results->savedRegisters[reg].value = offset; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_offset_extended(reg=%lld, offset=%lld)\n", reg, offset); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_offset_extended(reg=%ld, offset=%ld)\n", reg, offset); - break; - case DW_CFA_restore_extended: - reg = addressSpace.getULEB128(p, instructionsEnd);; -@@ -573,7 +573,7 @@ - return false; - } - results->savedRegisters[reg] = initialState.savedRegisters[reg]; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_restore_extended(reg=%lld)\n", reg); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_restore_extended(reg=%ld)\n", reg); - break; - case DW_CFA_undefined: - reg = addressSpace.getULEB128(p, instructionsEnd); -@@ -582,7 +582,7 @@ - return false; - } - results->savedRegisters[reg].location = kRegisterUnused; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_undefined(reg=%lld)\n", reg); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_undefined(reg=%ld)\n", reg); - break; - case DW_CFA_same_value: - reg = addressSpace.getULEB128(p, instructionsEnd); -@@ -597,7 +597,7 @@ - results->savedRegisters[reg].location = kRegisterUnused; - // set flag to disable conversion to compact unwind - results->sameValueUsed = true; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_same_value(reg=%lld)\n", reg); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_same_value(reg=%ld)\n", reg); - break; - case DW_CFA_register: - reg = addressSpace.getULEB128(p, instructionsEnd); -@@ -614,7 +614,7 @@ - results->savedRegisters[reg].value = reg2; - // set flag to disable conversion to compact unwind - results->registersInOtherRegisters = true; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_register(reg=%lld, reg2=%lld)\n", reg, reg2); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_register(reg=%ld, reg2=%ld)\n", reg, reg2); - break; - case DW_CFA_remember_state: - // avoid operator new, because that would be an upward dependency -@@ -652,7 +652,7 @@ - results->cfaRegisterOffset = offset; - if ( offset > 0x80000000 ) - results->cfaOffsetWasNegative = true; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_def_cfa(reg=%lld, offset=%lld)\n", reg, offset); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_def_cfa(reg=%ld, offset=%ld)\n", reg, offset); - break; - case DW_CFA_def_cfa_register: - reg = addressSpace.getULEB128(p, instructionsEnd); -@@ -661,7 +661,7 @@ - return false; - } - results->cfaRegister = reg; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_def_cfa_register(%lld)\n", reg); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_def_cfa_register(%ld)\n", reg); - break; - case DW_CFA_def_cfa_offset: - results->cfaRegisterOffset = addressSpace.getULEB128(p, instructionsEnd); -@@ -673,7 +673,7 @@ - results->cfaExpression = p; - length = addressSpace.getULEB128(p, instructionsEnd); - p += length; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_def_cfa_expression(expression=0x%llX, length=%llu)\n", -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_def_cfa_expression(expression=0x%lX, length=%lu)\n", - results->cfaExpression, length); - break; - case DW_CFA_expression: -@@ -686,7 +686,7 @@ - results->savedRegisters[reg].value = p; - length = addressSpace.getULEB128(p, instructionsEnd); - p += length; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_expression(reg=%lld, expression=0x%llX, length=%llu)\n", -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_expression(reg=%ld, expression=0x%lX, length=%lu)\n", - reg, results->savedRegisters[reg].value, length); - break; - case DW_CFA_offset_extended_sf: -@@ -700,7 +700,7 @@ - results->registerSavedMoreThanOnce = true; - results->savedRegisters[reg].location = kRegisterInCFA; - results->savedRegisters[reg].value = offset; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_offset_extended_sf(reg=%lld, offset=%lld)\n", reg, offset); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_offset_extended_sf(reg=%ld, offset=%ld)\n", reg, offset); - break; - case DW_CFA_def_cfa_sf: - reg = addressSpace.getULEB128(p, instructionsEnd); -@@ -711,7 +711,7 @@ - } - results->cfaRegister = reg; - results->cfaRegisterOffset = offset; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_def_cfa_sf(reg=%lld, offset=%lld)\n", reg, offset); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_def_cfa_sf(reg=%ld, offset=%ld)\n", reg, offset); - break; - case DW_CFA_def_cfa_offset_sf: - results->cfaRegisterOffset = addressSpace.getSLEB128(p, instructionsEnd) * cieInfo.dataAlignFactor; -@@ -723,7 +723,7 @@ - offset = addressSpace.getULEB128(p, instructionsEnd) * cieInfo.dataAlignFactor; - results->savedRegisters[reg].location = kRegisterOffsetFromCFA; - results->savedRegisters[reg].value = offset; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_val_offset(reg=%lld, offset=%lld\n", reg, offset); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_val_offset(reg=%ld, offset=%ld\n", reg, offset); - break; - case DW_CFA_val_offset_sf: - reg = addressSpace.getULEB128(p, instructionsEnd); -@@ -734,7 +734,7 @@ - offset = addressSpace.getSLEB128(p, instructionsEnd) * cieInfo.dataAlignFactor; - results->savedRegisters[reg].location = kRegisterOffsetFromCFA; - results->savedRegisters[reg].value = offset; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_val_offset_sf(reg=%lld, offset=%lld\n", reg, offset); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_val_offset_sf(reg=%ld, offset=%ld\n", reg, offset); - break; - case DW_CFA_val_expression: - reg = addressSpace.getULEB128(p, instructionsEnd); -@@ -746,13 +746,13 @@ - results->savedRegisters[reg].value = p; - length = addressSpace.getULEB128(p, instructionsEnd); - p += length; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_val_expression(reg=%lld, expression=0x%llX, length=%lld)\n", -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_val_expression(reg=%ld, expression=0x%lX, length=%ld)\n", - reg, results->savedRegisters[reg].value, length); - break; - case DW_CFA_GNU_args_size: - offset = addressSpace.getULEB128(p, instructionsEnd); - results->spExtraArgSize = offset; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_GNU_args_size(%lld)\n", offset); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_GNU_args_size(%ld)\n", offset); - break; - case DW_CFA_GNU_negative_offset_extended: - reg = addressSpace.getULEB128(p, instructionsEnd); -@@ -765,7 +765,7 @@ - results->registerSavedMoreThanOnce = true; - results->savedRegisters[reg].location = kRegisterInCFA; - results->savedRegisters[reg].value = -offset; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_GNU_negative_offset_extended(%lld)\n", offset); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_GNU_negative_offset_extended(%ld)\n", offset); - break; - default: - operand = opcode & 0x3F; -@@ -784,7 +784,7 @@ - } - results->savedRegisters[reg].location = kRegisterInCFA; - results->savedRegisters[reg].value = offset; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_offset(reg=%d, offset=%lld)\n", operand, offset); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_offset(reg=%d, offset=%ld)\n", operand, offset); - break; - case DW_CFA_advance_loc: - codeOffset += operand * cieInfo.codeAlignFactor; -@@ -796,7 +796,7 @@ - //return true; // gcc-4.5 starts the epilog with this - reg = operand; - results->savedRegisters[reg] = initialState.savedRegisters[reg]; -- if ( logDwarf ) fprintf(stderr, "DW_CFA_restore(reg=%lld)\n", reg); -+ if ( logDwarf ) fprintf(stderr, "DW_CFA_restore(reg=%ld)\n", reg); - break; - default: - if ( logDwarf ) fprintf(stderr, "unknown CFA opcode 0x%02X\n", opcode); -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/parsers/macho_relocatable_file.cpp cctools-port-format/cctools/ld64/src/ld/parsers/macho_relocatable_file.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/parsers/macho_relocatable_file.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/parsers/macho_relocatable_file.cpp 2017-11-10 19:13:05.918259550 -0800 -@@ -902,7 +902,7 @@ - { - const macho_section

* sct = this->sect().machoSection(); - if ( this->_objAddress > sct->addr() + sct->size() ) -- throwf("malformed .o file, symbol has address 0x%0llX which is outside range of its section", (uint64_t)this->_objAddress); -+ throwf("malformed .o file, symbol has address 0x%0lX which is outside range of its section", (uint64_t)this->_objAddress); - uint32_t fileOffset = sct->offset() - sct->addr() + this->_objAddress; - return this->sect().file().fileContent()+fileOffset; - } -@@ -1561,7 +1561,7 @@ - const macho_nlist

& sym = parser.symbolFromIndex(sortedSymbolIndexes[symIndex]); - if ( ! sect.ignoreLabel(parser.nameFromSymbol(sym)) ) { - pint_t nextSymbolAddr = sym.n_value(); -- //fprintf(stderr, "sectNum=%d, nextSymbolAddr=0x%08llX, name=%s\n", sectNum, (uint64_t)nextSymbolAddr, parser.nameFromSymbol(sym)); -+ //fprintf(stderr, "sectNum=%d, nextSymbolAddr=0x%08lX, name=%s\n", sectNum, (uint64_t)nextSymbolAddr, parser.nameFromSymbol(sym)); - if ( (nextSymbolAddr > startAddr) || ((nextSymbolAddr == startAddr) && (sym.n_sect() == sectNum)) ) - break; - } -@@ -1801,7 +1801,7 @@ - for(uint32_t i=0; i < countOfCFIs; ++i) { - if ( cfiArray[i].isCIE ) - continue; -- //fprintf(stderr, "cfiArray[i].func = 0x%08llX, cfiArray[i].lsda = 0x%08llX, encoding=0x%08X\n", -+ //fprintf(stderr, "cfiArray[i].func = 0x%08lX, cfiArray[i].lsda = 0x%08lX, encoding=0x%08X\n", - // (uint64_t)cfiArray[i].u.fdeInfo.function.targetAddress, - // (uint64_t)cfiArray[i].u.fdeInfo.lsda.targetAddress, - // cfiArray[i].u.fdeInfo.compactUnwindInfo); -@@ -1865,7 +1865,7 @@ - breakIterator.beginSection(); - uint32_t count = sections[i]->computeAtomCount(*this, breakIterator, cfis); - //const macho_section

* sect = sections[i]->machoSection(); -- //fprintf(stderr, "computed count=%u for section %s size=%llu\n", count, sect->sectname(), (sect != NULL) ? sect->size() : 0); -+ //fprintf(stderr, "computed count=%u for section %s size=%lu\n", count, sect->sectname(), (sect != NULL) ? sect->size() : 0); - computedAtomCount += count; - } - //fprintf(stderr, "allocating %d atoms * sizeof(Atom)=%ld, sizeof(ld::Atom)=%ld\n", computedAtomCount, sizeof(Atom), sizeof(ld::Atom)); -@@ -2340,7 +2340,7 @@ - if ( log ) { - fprintf(stderr, "unsorted sections:\n"); - for(unsigned int i=0; i < _machOSectionsCount; ++i ) -- fprintf(stderr, "0x%08llX %s %s\n", _sectionsStart[i].addr(), _sectionsStart[i].segname(), _sectionsStart[i].sectname()); -+ fprintf(stderr, "0x%08lX %s %s\n", _sectionsStart[i].addr(), _sectionsStart[i].segname(), _sectionsStart[i].sectname()); - } - - // sort by symbol table address -@@ -2351,7 +2351,7 @@ - if ( log ) { - fprintf(stderr, "sorted sections:\n"); - for(unsigned int i=0; i < _machOSectionsCount; ++i ) -- fprintf(stderr, "0x%08llX %s %s\n", _sectionsStart[array[i]].addr(), _sectionsStart[array[i]].segname(), _sectionsStart[array[i]].sectname()); -+ fprintf(stderr, "0x%08lX %s %s\n", _sectionsStart[array[i]].addr(), _sectionsStart[array[i]].segname(), _sectionsStart[array[i]].sectname()); - } - } - -@@ -2446,7 +2446,7 @@ - _overlappingSymbols = false; - for (unsigned int i=1; i < _symbolsInSections; ++i) { - if ( symbolFromIndex(array[i-1]).n_value() == symbolFromIndex(array[i]).n_value() ) { -- //fprintf(stderr, "overlapping symbols at 0x%08llX\n", symbolFromIndex(array[i-1]).n_value()); -+ //fprintf(stderr, "overlapping symbols at 0x%08lX\n", symbolFromIndex(array[i-1]).n_value()); - _overlappingSymbols = true; - break; - } -@@ -2455,7 +2455,7 @@ - if ( log ) { - fprintf(stderr, "sorted symbols:\n"); - for(unsigned int i=0; i < _symbolsInSections; ++i ) -- fprintf(stderr, "0x%09llX symIndex=%d sectNum=%2d, %s\n", symbolFromIndex(array[i]).n_value(), array[i], symbolFromIndex(array[i]).n_sect(), nameFromSymbol(symbolFromIndex(array[i])) ); -+ fprintf(stderr, "0x%09lX symIndex=%d sectNum=%2d, %s\n", symbolFromIndex(array[i]).n_value(), array[i], symbolFromIndex(array[i]).n_sect(), nameFromSymbol(symbolFromIndex(array[i])) ); - } - } - -@@ -2553,7 +2553,7 @@ - _file->_swiftVersion = ((flags >> 8) & 0xFF); - _file->_objcHasCategoryClassPropertiesField = (flags & 64); - if ( sect->size() > 8 ) { -- warning("section %s/%s has unexpectedly large size %llu in %s", -+ warning("section %s/%s has unexpectedly large size %lu in %s", - sect->segname(), Section::makeSectionName(sect), sect->size(), _file->path()); - } - } -@@ -2805,7 +2805,7 @@ - } - } - -- throwf("sectionForAddress(0x%llX) address not in any section", (uint64_t)addr); -+ throwf("sectionForAddress(0x%lX) address not in any section", (uint64_t)addr); - } - - template -@@ -3540,7 +3540,7 @@ - di += 4; - break; - default: -- warning("unknown dwarf string encoding (form=%lld) in %s", form, this->_path); -+ warning("unknown dwarf string encoding (form=%ld) in %s", form, this->_path); - break; - } - return result; -@@ -3647,7 +3647,7 @@ - std::map dwarfIndexToFile; - if ( lines != NULL ) { - while ( line_next(lines, &result, line_stop_pc) ) { -- //fprintf(stderr, "curAtom=%p, result.pc=0x%llX, result.line=%llu, result.end_of_sequence=%d," -+ //fprintf(stderr, "curAtom=%p, result.pc=0x%lX, result.line=%lu, result.end_of_sequence=%d," - // " curAtomAddress=0x%X, curAtomSize=0x%X\n", - // curAtom, result.pc, result.line, result.end_of_sequence, curAtomAddress, curAtomSize); - // work around weird debug line table compiler generates if no functions in __text section -@@ -3720,7 +3720,7 @@ - entry.info.atomOffset = curAtomOffset; - entry.info.fileName = filename; - entry.info.lineNumber = result.line; -- //fprintf(stderr, "addr=0x%08llX, line=%lld, file=%s, atom=%s, atom.size=0x%X, end=%d\n", -+ //fprintf(stderr, "addr=0x%08lX, line=%ld, file=%s, atom=%s, atom.size=0x%X, end=%d\n", - // result.pc, result.line, filename, curAtom->name(), curAtomSize, result.end_of_sequence); - entries.push_back(entry); - curAtom->incrementLineInfoCount(); -@@ -3796,7 +3796,7 @@ - stab.string = symString; - } - else { -- fprintf(stderr, "can't find atom for stabs BNSYM at %08llX in %s", -+ fprintf(stderr, "can't find atom for stabs BNSYM at %08lX in %s", - (uint64_t)sym.n_value(), _path); - } - break; -@@ -3859,7 +3859,7 @@ - stab.string = symString; - } - else { -- warning("can't find atom for stabs FUN at %08llX in %s", -+ warning("can't find atom for stabs FUN at %08lX in %s", - (uint64_t)currentAtomAddress, _path); - } - } -@@ -3895,7 +3895,7 @@ - stab.string = symString; - } - else { -- warning("can't find atom for stabs 0x%X at %08llX in %s", -+ warning("can't find atom for stabs 0x%X at %08lX in %s", - type, (uint64_t)sym.n_value(), _path); - } - break; -@@ -3927,7 +3927,7 @@ - stab.string = symString; - } - else { -- warning("can't find atom for stabs FUN at %08llX in %s", -+ warning("can't find atom for stabs FUN at %08lX in %s", - (uint64_t)currentAtomAddress, _path); - } - } -@@ -4339,7 +4339,7 @@ - const uint32_t sectionAlignment = this->_machOSection->align(); - uint32_t modulus = (addr % (1 << sectionAlignment)); - if ( modulus > 0xFFFF ) -- warning("alignment for symbol at address 0x%08llX in %s exceeds 2^16", (uint64_t)addr, this->file().path()); -+ warning("alignment for symbol at address 0x%08lX in %s exceeds 2^16", (uint64_t)addr, this->file().path()); - return ld::Atom::Alignment(sectionAlignment, modulus); - } - -@@ -4842,7 +4842,7 @@ - } - } - } -- throwf("__eh_frame parsing problem. Can't find target of reference to address 0x%08llX", (uint64_t)addr); -+ throwf("__eh_frame parsing problem. Can't find target of reference to address 0x%08lX", (uint64_t)addr); - } - } - -@@ -5403,7 +5403,7 @@ - skip = true; - } - else { -- //fprintf(stderr, " 0x%08llX make annon, size=%lld\n", (uint64_t)foundAddr, (uint64_t)size); -+ //fprintf(stderr, " 0x%08lX make annon, size=%ld\n", (uint64_t)foundAddr, (uint64_t)size); - new (allocatedSpace) Atom(*this, this->unlabeledAtomName(parser, foundAddr), foundAddr, - this->elementSizeAtAddress(foundAddr), this->definition(), - this->combine(parser, foundAddr), this->scopeAtAddress(parser, foundAddr), -@@ -5413,7 +5413,7 @@ - } - else { - // make named atom for label -- //fprintf(stderr, " 0x%08llX make labeled\n", (uint64_t)foundAddr); -+ //fprintf(stderr, " 0x%08lX make labeled\n", (uint64_t)foundAddr); - new (allocatedSpace) Atom(*this, parser, *foundLabel, labeledAtomSize); - } - if ( !skip ) { -@@ -5427,7 +5427,7 @@ - for (pint_t addr = foundAddr; addr < (foundAddr+size); addr += elementSizeAtAddress(addr) ) { - // make anon atoms for area before label - if ( this->useElementAt(parser, it, addr) ) { -- //fprintf(stderr, " 0x%08llX make annon, size=%lld\n", (uint64_t)addr, (uint64_t)elementSizeAtAddress(addr)); -+ //fprintf(stderr, " 0x%08lX make annon, size=%ld\n", (uint64_t)addr, (uint64_t)elementSizeAtAddress(addr)); - allocatedSpace = (Atom*)p; - new (allocatedSpace) Atom(*this, this->unlabeledAtomName(parser, addr), addr, this->elementSizeAtAddress(addr), - this->definition(), this->combine(parser, addr), this->scopeAtAddress(parser, addr), -@@ -7587,17 +7587,17 @@ - const uint64_t atomEndAddr = atomStartAddr + inAtom->size(); - for(int i=0; i < count; ++i) { - if ( (addrs[i] < atomStartAddr) || (addrs[i] >= atomEndAddr) ) { -- warning("arm64 Linker Optimiztion Hint addresses are not in same atom: 0x%08llX and 0x%08llX", -+ warning("arm64 Linker Optimiztion Hint addresses are not in same atom: 0x%08lX and 0x%08lX", - lowestAddress, addrs[i]); - return; // skip this LOH - } - if ( (addrs[i] & 0x3) != 0 ) { -- warning("arm64 Linker Optimiztion Hint address is not 4-byte aligned: 0x%08llX", addrs[i]); -+ warning("arm64 Linker Optimiztion Hint address is not 4-byte aligned: 0x%08lX", addrs[i]); - return; // skip this LOH - } - if ( (addrs[i] - lowestAddress) > 0xFFFF ) { - if ( parser.verboseOptimizationHints() ) { -- warning("arm64 Linker Optimiztion Hint addresses are too far apart: 0x%08llX and 0x%08llX", -+ warning("arm64 Linker Optimiztion Hint addresses are too far apart: 0x%08lX and 0x%08lX", - lowestAddress, addrs[i]); - } - return; // skip this LOH -@@ -7785,7 +7785,7 @@ - this->addLOH(parser, kind, count, addrs); - //fprintf(stderr, "kind=%d", kind); - //for (int32_t i=0; i < count; ++i) { -- // fprintf(stderr, ", addr=0x%08llX", addrs[i]); -+ // fprintf(stderr, ", addr=0x%08lX", addrs[i]); - //} - //fprintf(stderr, "\n"); - } -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/passes/branch_island.cpp cctools-port-format/cctools/ld64/src/ld/passes/branch_island.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/passes/branch_island.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/passes/branch_island.cpp 2017-11-10 19:13:05.918259550 -0800 -@@ -451,7 +451,7 @@ - uint64_t totalTextSize = offset + stubCount*16; - if ( (totalTextSize < textSizeWhenMightNeedBranchIslands(opts, hasThumbBranches)) && !haveCrossSectionBranches ) - return; -- if (_s_log) fprintf(stderr, "ld: section %s size=%llu, might need branch islands\n", textSection->sectionName(), totalTextSize); -+ if (_s_log) fprintf(stderr, "ld: section %s size=%lu, might need branch islands\n", textSection->sectionName(), totalTextSize); - - // Figure out how many regions of branch islands will be needed, and their locations. - // Construct a vector containing the atoms after which branch islands will be inserted, -@@ -493,7 +493,7 @@ - regionsMap[i] = new AtomToIsland(); - regionsIslands[i] = new std::vector(); - regionAddresses[i] = branchIslandInsertionPoints[i]->sectionOffset() + branchIslandInsertionPoints[i]->size(); -- if (_s_log) fprintf(stderr, "ld: branch islands will be inserted at 0x%08llX after %s\n", regionAddresses[i], branchIslandInsertionPoints[i]->name()); -+ if (_s_log) fprintf(stderr, "ld: branch islands will be inserted at 0x%08lX after %s\n", regionAddresses[i], branchIslandInsertionPoints[i]->name()); - } - unsigned int islandCount = 0; - -@@ -561,7 +561,7 @@ - if ( pos == region->end() ) { - island = makeBranchIsland(opts, fit->kind, 0, target, finalTargetAndOffset, atom->section(), true); - (*region)[finalTargetAndOffset] = island; -- if (_s_log) fprintf(stderr, "added absolute branching island %p %s, displacement=%lld\n", -+ if (_s_log) fprintf(stderr, "added absolute branching island %p %s, displacement=%ld\n", - island, island->name(), displacement); - ++islandCount; - regionsIslands[0]->push_back(island); -@@ -577,7 +577,7 @@ - else if ( displacement > kBranchLimit ) { - // create forward branch chain - const ld::Atom* nextTarget = target; -- if (_s_log) fprintf(stderr, "need forward branching island srcAdr=0x%08llX, dstAdr=0x%08llX, target=%s\n", -+ if (_s_log) fprintf(stderr, "need forward branching island srcAdr=0x%08lX, dstAdr=0x%08lX, target=%s\n", - srcAddr, dstAddr, target->name()); - for (int i=kIslandRegionsCount-1; i >=0 ; --i) { - AtomToIsland* region = regionsMap[i]; -@@ -609,7 +609,7 @@ - AtomToIsland* region = regionsMap[i]; - int64_t islandRegionAddr = regionAddresses[i]; - if ( (dstAddr < islandRegionAddr) && (islandRegionAddr <= srcAddr) ) { -- if (_s_log) fprintf(stderr, "need backward branching island srcAdr=0x%08llX, dstAdr=0x%08llX, target=%s\n", srcAddr, dstAddr, target->name()); -+ if (_s_log) fprintf(stderr, "need backward branching island srcAdr=0x%08lX, dstAdr=0x%08lX, target=%s\n", srcAddr, dstAddr, target->name()); - AtomToIsland::iterator pos = region->find(finalTargetAndOffset); - if ( pos == region->end() ) { - ld::Atom* island = makeBranchIsland(opts, fit->kind, i, prevTarget, finalTargetAndOffset, atom->section(), false); -@@ -670,7 +670,7 @@ - ld::Internal::FinalSection* sect = *sit; - uint16_t maxAlignment = 0; - uint64_t offset = 0; -- if ( log ) fprintf(stderr, " section=%s/%s, address=0x%08llX\n", sect->segmentName(), sect->sectionName(), sect->address); -+ if ( log ) fprintf(stderr, " section=%s/%s, address=0x%08lX\n", sect->segmentName(), sect->sectionName(), sect->address); - for (std::vector::iterator ait = sect->atoms.begin(); ait != sect->atoms.end(); ++ait) { - const ld::Atom* atom = *ait; - uint32_t atomAlignmentPowerOf2 = atom->alignment().powerOf2; -@@ -688,7 +688,7 @@ - offset += requiredModulus+alignment-currentModulus; - } - -- if ( log ) fprintf(stderr, " 0x%08llX atom=%p, name=%s\n", sect->address+offset, atom, atom->name()); -+ if ( log ) fprintf(stderr, " 0x%08lX atom=%p, name=%s\n", sect->address+offset, atom, atom->name()); - sAtomToAddress[atom] = sect->address + offset; - - offset += atom->size(); -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/passes/code_dedup.cpp cctools-port-format/cctools/ld64/src/ld/passes/code_dedup.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/passes/code_dedup.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/passes/code_dedup.cpp 2017-11-10 19:13:05.918259550 -0800 -@@ -296,7 +296,7 @@ - continue; - if ( verbose ) { - dedupSavings += ((dups.size() - 1) * masterAtom->size()); -- fprintf(stderr, "deduplicate the following %lu functions (%llu bytes apiece):\n", dups.size(), masterAtom->size()); -+ fprintf(stderr, "deduplicate the following %lu functions (%lu bytes apiece):\n", dups.size(), masterAtom->size()); - } - for (const ld::Atom* dupAtom : dups) { - if ( verbose ) -@@ -313,7 +313,7 @@ - } - } - if ( verbose ) { -- fprintf(stderr, "deduplication saved %llu bytes of __text\n", dedupSavings); -+ fprintf(stderr, "deduplication saved %lu bytes of __text\n", dedupSavings); - } - - if ( log ) { -@@ -348,7 +348,7 @@ - if ( log ) { - fprintf(stderr, "atoms before pruning:\n"); - for (const ld::Atom* atom : textSection->atoms) -- fprintf(stderr, " %p (size=%llu) %sp\n", atom, atom->size(), atom->name()); -+ fprintf(stderr, " %p (size=%lu) %sp\n", atom, atom->size(), atom->name()); - } - // remove replaced atoms from section - textSection->atoms.erase(std::remove_if(textSection->atoms.begin(), textSection->atoms.end(), -@@ -363,7 +363,7 @@ - if ( log ) { - fprintf(stderr, "atoms after pruning:\n"); - for (const ld::Atom* atom : textSection->atoms) -- fprintf(stderr, " %p (size=%llu) %sp\n", atom, atom->size(), atom->name()); -+ fprintf(stderr, " %p (size=%lu) %sp\n", atom, atom->size(), atom->name()); - } - - //fprintf(stderr, "hash-count=%lu, fixup-compares=%lu, atom-count=%u\n", sHashCount, sFixupCompareCount, atomsBeingComparedCount); -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/passes/dtrace_dof.cpp cctools-port-format/cctools/ld64/src/ld/passes/dtrace_dof.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/passes/dtrace_dof.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/passes/dtrace_dof.cpp 2017-11-10 19:13:05.918259550 -0800 -@@ -308,9 +308,9 @@ - f->reserveFixups(3*probeCount); - for (uint32_t i=0; i < probeCount; ++i) { - uint64_t offset = offsetsInDOF[i]; -- //fprintf(stderr, "%s offset[%d]=0x%08llX\n", providerName, i, offset); -+ //fprintf(stderr, "%s offset[%d]=0x%08lX\n", providerName, i, offset); - if ( offset > dofSectionSize ) -- throwf("offsetsInDOF[%d]=%0llX > dofSectionSize=%0lX\n", i, offset, dofSectionSize); -+ throwf("offsetsInDOF[%d]=%0lX > dofSectionSize=%0lX\n", i, offset, dofSectionSize); - f->addSectionFixup(ld::Fixup(offset, ld::Fixup::k1of4, ld::Fixup::kindSetTargetAddress, probes[i].atom)); - f->addSectionFixup(ld::Fixup(offset, ld::Fixup::k2of4, ld::Fixup::kindAddAddend, probes[i].offset)); - f->addSectionFixup(ld::Fixup(offset, ld::Fixup::k3of4, ld::Fixup::kindSubtractTargetAddress, &f->atom())); -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/passes/huge.cpp cctools-port-format/cctools/ld64/src/ld/passes/huge.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/passes/huge.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/passes/huge.cpp 2017-11-10 19:13:05.921592917 -0800 -@@ -115,7 +115,7 @@ - const ld::Atom* atom = *ait; - if ( (address > 0x7FFFFFFFLL) && !sect->isSectionHidden() ) { - state.usingHugeSections = true; -- if (log) fprintf(stderr, "atom: %s is >2GB (0x%09llX), so enabling huge mode\n", atom->name(), address); -+ if (log) fprintf(stderr, "atom: %s is >2GB (0x%09lX), so enabling huge mode\n", atom->name(), address); - break; - } - address += atom->size(); -@@ -139,7 +139,7 @@ - if ( atom->size() > 1024*1024 ) { - hugeSection->atoms.push_back(atom); - state.atomToSection[atom] = hugeSection; -- if (log) fprintf(stderr, "moved to __huge: %s, size=%llu\n", atom->name(), atom->size()); -+ if (log) fprintf(stderr, "moved to __huge: %s, size=%lu\n", atom->name(), atom->size()); - *ait = NULL; // change atom to NULL for later bulk removal - movedSome = true; - } -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/SymbolTable.cpp cctools-port-format/cctools/ld64/src/ld/SymbolTable.cpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/SymbolTable.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/ld/SymbolTable.cpp 2017-11-10 19:13:05.921592917 -0800 -@@ -324,7 +324,7 @@ - if ( _atomB.size() > _atomA.size() ) { - const char* atomApath = (_atomA.file() != NULL) ? _atomA.file()->path() : ""; - const char* atomBpath = (_atomB.file() != NULL) ? _atomB.file()->path() : ""; -- warning("tentative definition of '%s' with size %llu from '%s' is being replaced by real definition of smaller size %llu from '%s'", -+ warning("tentative definition of '%s' with size %lu from '%s' is being replaced by real definition of smaller size %lu from '%s'", - _atomA.name(), _atomB.size(), atomBpath, _atomA.size(), atomApath); - } - pickAtomA(); -@@ -344,7 +344,7 @@ - if ( _atomA.size() > _atomB.size() ) { - const char* atomApath = (_atomA.file() != NULL) ? _atomA.file()->path() : ""; - const char* atomBpath = (_atomB.file() != NULL) ? _atomB.file()->path() : ""; -- warning("tentative definition of '%s' with size %llu from '%s' is being replaced by real definition of smaller size %llu from '%s'", -+ warning("tentative definition of '%s' with size %lu from '%s' is being replaced by real definition of smaller size %lu from '%s'", - _atomA.name(), _atomA.size(),atomApath, _atomB.size(), atomBpath); - } - pickAtomB(); -diff -ur cctools-port-c1cc758/cctools/ld64/src/other/dyldinfo.cpp cctools-port-format/cctools/ld64/src/other/dyldinfo.cpp ---- cctools-port-c1cc758/cctools/ld64/src/other/dyldinfo.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/other/dyldinfo.cpp 2017-11-10 19:13:05.921592917 -0800 -@@ -587,7 +587,7 @@ - return i; - } - } -- throwf("address 0x%llX is not in any segment", (uint64_t)address); -+ throwf("address 0x%lX is not in any segment", (uint64_t)address); - } - - template -@@ -599,7 +599,7 @@ - return (pint_t*)((uint8_t*)fHeader + offsetInMappedFile); - } - } -- throwf("address 0x%llX is not in any segment", (uint64_t)vmaddress); -+ throwf("address 0x%lX is not in any segment", (uint64_t)vmaddress); - } - - template -@@ -686,26 +686,26 @@ - break; - case REBASE_OPCODE_DO_REBASE_IMM_TIMES: - for (int i=0; i < immediate; ++i) { -- printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += sizeof(pint_t); - } - break; - case REBASE_OPCODE_DO_REBASE_ULEB_TIMES: - count = read_uleb128(p, end); - for (uint32_t i=0; i < count; ++i) { -- printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += sizeof(pint_t); - } - break; - case REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB: -- printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += read_uleb128(p, end) + sizeof(pint_t); - break; - case REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB: - count = read_uleb128(p, end); - skip = read_uleb128(p, end); - for (uint32_t i=0; i < count; ++i) { -- printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += skip + sizeof(pint_t); - } - break; -@@ -754,15 +754,15 @@ - case REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: - segmentIndex = immediate; - address = read_uleb128(p, end); -- printf("0x%04X REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(%d, 0x%08llX)\n", opcodeOffset, segmentIndex, address); -+ printf("0x%04X REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(%d, 0x%08lX)\n", opcodeOffset, segmentIndex, address); - break; - case REBASE_OPCODE_ADD_ADDR_ULEB: - address = read_uleb128(p, end); -- printf("0x%04X REBASE_OPCODE_ADD_ADDR_ULEB(0x%0llX)\n", opcodeOffset, address); -+ printf("0x%04X REBASE_OPCODE_ADD_ADDR_ULEB(0x%0lX)\n", opcodeOffset, address); - break; - case REBASE_OPCODE_ADD_ADDR_IMM_SCALED: - address = immediate*sizeof(pint_t); -- printf("0x%04X REBASE_OPCODE_ADD_ADDR_IMM_SCALED(0x%0llX)\n", opcodeOffset, address); -+ printf("0x%04X REBASE_OPCODE_ADD_ADDR_IMM_SCALED(0x%0lX)\n", opcodeOffset, address); - break; - case REBASE_OPCODE_DO_REBASE_IMM_TIMES: - printf("0x%04X REBASE_OPCODE_DO_REBASE_IMM_TIMES(%d)\n", opcodeOffset, immediate); -@@ -871,12 +871,12 @@ - break; - case BIND_OPCODE_SET_ADDEND_SLEB: - addend = read_sleb128(p, end); -- printf("0x%04X BIND_OPCODE_SET_ADDEND_SLEB(%lld)\n", opcodeOffset, addend); -+ printf("0x%04X BIND_OPCODE_SET_ADDEND_SLEB(%ld)\n", opcodeOffset, addend); - break; - case BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: - segmentIndex = immediate; - address = read_uleb128(p, end); -- printf("0x%04X BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(0x%02X, 0x%08llX)\n", opcodeOffset, segmentIndex, address); -+ printf("0x%04X BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(0x%02X, 0x%08lX)\n", opcodeOffset, segmentIndex, address); - break; - case BIND_OPCODE_ADD_ADDR_ULEB: - skip = read_uleb128(p, end); -@@ -987,22 +987,22 @@ - segOffset += read_uleb128(p, end); - break; - case BIND_OPCODE_DO_BIND: -- printf("%-7s %-16s 0x%08llX %10s %5lld %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, fromDylib, symbolName, weak_import ); -+ printf("%-7s %-16s 0x%08lX %10s %5ld %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, fromDylib, symbolName, weak_import ); - segOffset += sizeof(pint_t); - break; - case BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: -- printf("%-7s %-16s 0x%08llX %10s %5lld %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, fromDylib, symbolName, weak_import ); -+ printf("%-7s %-16s 0x%08lX %10s %5ld %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, fromDylib, symbolName, weak_import ); - segOffset += read_uleb128(p, end) + sizeof(pint_t); - break; - case BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED: -- printf("%-7s %-16s 0x%08llX %10s %5lld %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, fromDylib, symbolName, weak_import ); -+ printf("%-7s %-16s 0x%08lX %10s %5ld %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, fromDylib, symbolName, weak_import ); - segOffset += immediate*sizeof(pint_t) + sizeof(pint_t); - break; - case BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: - count = read_uleb128(p, end); - skip = read_uleb128(p, end); - for (uint32_t i=0; i < count; ++i) { -- printf("%-7s %-16s 0x%08llX %10s %5lld %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, fromDylib, symbolName, weak_import ); -+ printf("%-7s %-16s 0x%08lX %10s %5ld %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, fromDylib, symbolName, weak_import ); - segOffset += skip + sizeof(pint_t); - } - break; -@@ -1070,22 +1070,22 @@ - segOffset += read_uleb128(p, end); - break; - case BIND_OPCODE_DO_BIND: -- printf("%-7s %-16s 0x%08llX %10s %5lld %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, symbolName ); -+ printf("%-7s %-16s 0x%08lX %10s %5ld %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, symbolName ); - segOffset += sizeof(pint_t); - break; - case BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: -- printf("%-7s %-16s 0x%08llX %10s %5lld %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, symbolName ); -+ printf("%-7s %-16s 0x%08lX %10s %5ld %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, symbolName ); - segOffset += read_uleb128(p, end) + sizeof(pint_t); - break; - case BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED: -- printf("%-7s %-16s 0x%08llX %10s %5lld %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, symbolName ); -+ printf("%-7s %-16s 0x%08lX %10s %5ld %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, symbolName ); - segOffset += immediate*sizeof(pint_t) + sizeof(pint_t); - break; - case BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: - count = read_uleb128(p, end); - skip = read_uleb128(p, end); - for (uint32_t i=0; i < count; ++i) { -- printf("%-7s %-16s 0x%08llX %10s %5lld %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, symbolName ); -+ printf("%-7s %-16s 0x%08lX %10s %5ld %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName, addend, symbolName ); - segOffset += skip + sizeof(pint_t); - } - break; -@@ -1178,7 +1178,7 @@ - segOffset += read_uleb128(p, end); - break; - case BIND_OPCODE_DO_BIND: -- printf("%-7s %-16s 0x%08llX 0x%04X %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, lazy_offset, fromDylib, symbolName, weak_import); -+ printf("%-7s %-16s 0x%08lX 0x%04X %-16s %s%s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, lazy_offset, fromDylib, symbolName, weak_import); - segOffset += sizeof(pint_t); - break; - default: -@@ -1252,12 +1252,12 @@ - break; - case BIND_OPCODE_SET_ADDEND_SLEB: - addend = read_sleb128(p, end); -- printf("0x%04X BIND_OPCODE_SET_ADDEND_SLEB(%lld)\n", opcodeOffset, addend); -+ printf("0x%04X BIND_OPCODE_SET_ADDEND_SLEB(%ld)\n", opcodeOffset, addend); - break; - case BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: - segmentIndex = immediate; - address = read_uleb128(p, end); -- printf("0x%04X BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(0x%02X, 0x%08llX)\n", opcodeOffset, segmentIndex, address); -+ printf("0x%04X BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(0x%02X, 0x%08lX)\n", opcodeOffset, segmentIndex, address); - break; - case BIND_OPCODE_ADD_ADDR_ULEB: - skip = read_uleb128(p, end); -@@ -1317,7 +1317,7 @@ - if ( reExport ) - printf("[re-export] "); - else -- printf("0x%08llX ", fBaseAddress+it->address); -+ printf("0x%08lX ", fBaseAddress+it->address); - printf("%s", it->name); - if ( weakDef || threadLocal || resolver || abs ) { - bool needComma = false; -@@ -1341,7 +1341,7 @@ - if ( resolver ) { - if ( needComma ) - printf(", "); -- printf("resolver=0x%08llX", it->other); -+ printf("resolver=0x%08lX", it->other); - needComma = true; - } - printf("]"); -@@ -1375,13 +1375,13 @@ - ++p; - ++p; - if ( *importName == '\0' ) -- printf("\tnode%03ld [ label=%s,re-export from dylib=%llu ];\n", (long)(me-start), cummulativeString, ordinal); -+ printf("\tnode%03ld [ label=%s,re-export from dylib=%lu ];\n", (long)(me-start), cummulativeString, ordinal); - else -- printf("\tnode%03ld [ label=%s,re-export %s from dylib=%llu ];\n", (long)(me-start), cummulativeString, importName, ordinal); -+ printf("\tnode%03ld [ label=%s,re-export %s from dylib=%lu ];\n", (long)(me-start), cummulativeString, importName, ordinal); - } - else { - uint64_t address = read_uleb128(p, end); -- printf("\tnode%03ld [ label=%s,addr0x%08llX ];\n", (long)(me-start), cummulativeString, address); -+ printf("\tnode%03ld [ label=%s,addr0x%08lX ];\n", (long)(me-start), cummulativeString, address); - if ( flags & EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER ) - read_uleb128(p, end); - } -@@ -1469,25 +1469,25 @@ - ++p; - ++p; - if ( strlen(importName) == 0 ) -- printf("[flags=REEXPORT ordinal=%llu] ", ordinal); -+ printf("[flags=REEXPORT ordinal=%lu] ", ordinal); - else -- printf("[flags=REEXPORT ordinal=%llu import=%s] ", ordinal, importName); -+ printf("[flags=REEXPORT ordinal=%lu import=%s] ", ordinal, importName); - } - else if ( flags & EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER ) { - uint64_t stub = read_uleb128(p, end); - uint64_t resolver = read_uleb128(p, end); -- printf("[flags=STUB_AND_RESOLVER stub=0x%06llX resolver=0x%06llX] ", stub, resolver); -+ printf("[flags=STUB_AND_RESOLVER stub=0x%06lX resolver=0x%06lX] ", stub, resolver); - } - else { - uint64_t address = read_uleb128(p, end); - if ( (flags & EXPORT_SYMBOL_FLAGS_KIND_MASK) == EXPORT_SYMBOL_FLAGS_KIND_REGULAR ) -- printf("[addr=0x%06llX] ", address); -+ printf("[addr=0x%06lX] ", address); - else if ( (flags & EXPORT_SYMBOL_FLAGS_KIND_MASK) == EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL) -- printf("[flags=THREAD_LOCAL addr=0x%06llX] ", address); -+ printf("[flags=THREAD_LOCAL addr=0x%06lX] ", address); - else if ( (flags & EXPORT_SYMBOL_FLAGS_KIND_MASK) == EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE) -- printf("[flags=ABSOLUTE addr=0x%06llX] ", address); -+ printf("[flags=ABSOLUTE addr=0x%06lX] ", address); - else -- printf("[flags=0x%llX addr=0x%06llX] ", flags, address); -+ printf("[flags=0x%lX addr=0x%06lX] ", flags, address); - } - } - // print child edges -@@ -1627,7 +1627,7 @@ - do { - delta = read_uleb128(p, end); - address += delta; -- printf("0x%0llX %s\n", address+fBaseAddress, kindStr); -+ printf("0x%0lX %s\n", address+fBaseAddress, kindStr); - } while (delta); - - return p; -@@ -1659,7 +1659,7 @@ - char fromSectionName[20]; - strncpy(fromSectionName, fromSection->sectname(), 16); - fromSectionName[16] = '\0'; -- printf("from sect=%s/%s, to sect=%s/%s, count=%lld:\n", fromSection->segname(), fromSectionName, toSection->segname(), toSection->sectname(), toOffsetCount); -+ printf("from sect=%s/%s, to sect=%s/%s, count=%ld:\n", fromSection->segname(), fromSectionName, toSection->segname(), toSection->sectname(), toOffsetCount); - uint64_t toSectionOffset = 0; - const char* lastFromSymbol = NULL; - for (uint64_t j=0; j < toOffsetCount; ++j) { -@@ -1678,12 +1678,12 @@ - if ( (s != lastFromSymbol) && (s != NULL) ) - printf(" %s:\n", s); - const char* toSymbol = closestSymbolNameForAddress(toSection->addr()+toSectionOffset, &symbolOffset, toSectionIndex); -- printf(" from addr=0x%0llX %s to addr=0x%0llX", fromSection->addr()+fromSectionOffset, sharedRegionKindName(kind), toSection->addr()+toSectionOffset); -+ printf(" from addr=0x%0lX %s to addr=0x%0lX", fromSection->addr()+fromSectionOffset, sharedRegionKindName(kind), toSection->addr()+toSectionOffset); - if ( toSymbol != NULL ) { - if ( symbolOffset == 0 ) - printf(" (%s)", toSymbol); - else -- printf(" (%s + %lld)", toSymbol, symbolOffset); -+ printf(" (%s + %ld)", toSymbol, symbolOffset); - } - printf("\n"); - lastFromSymbol = s; -@@ -1740,16 +1740,16 @@ - void DyldInfoPrinter::printFunctionStartLine(uint64_t addr) - { - if ( addr & 1 ) -- printf("0x%0llX [thumb] %s\n", (addr & -2), symbolNameForAddress(addr & -2)); -+ printf("0x%0lX [thumb] %s\n", (addr & -2), symbolNameForAddress(addr & -2)); - else -- printf("0x%0llX %s\n", addr, symbolNameForAddress(addr)); -+ printf("0x%0lX %s\n", addr, symbolNameForAddress(addr)); - } - #endif - - template - void DyldInfoPrinter::printFunctionStartLine(uint64_t addr) - { -- printf("0x%0llX %s\n", addr, symbolNameForAddress(addr)); -+ printf("0x%0lX %s\n", addr, symbolNameForAddress(addr)); - } - - -@@ -2023,7 +2023,7 @@ - const char* typeName = relocTypeName(reloc->r_type()); - const char* segName = segmentName(segIndex); - const char* sectName = sectionName(segIndex, addr); -- printf("%-8s %-16s 0x%08llX %s\n", segName, sectName, (uint64_t)addr, typeName); -+ printf("%-8s %-16s 0x%08lX %s\n", segName, sectName, (uint64_t)addr, typeName); - } - else { - const macho_scattered_relocation_info

* sreloc = (macho_scattered_relocation_info

*)reloc; -@@ -2032,7 +2032,7 @@ - const char* typeName = relocTypeName(sreloc->r_type()); - const char* segName = segmentName(segIndex); - const char* sectName = sectionName(segIndex, addr); -- printf("%-8s %-16s 0x%08llX %s\n", segName, sectName, (uint64_t)addr, typeName); -+ printf("%-8s %-16s 0x%08lX %s\n", segName, sectName, (uint64_t)addr, typeName); - } - } - // look for local non-lazy-pointers -@@ -2054,7 +2054,7 @@ - const char* typeName = "pointer"; - const char* segName = segmentName(segIndex); - const char* sectName = sectionName(segIndex, addr); -- printf("%-8s %-16s 0x%08llX %s\n", segName, sectName, (uint64_t)addr, typeName); -+ printf("%-8s %-16s 0x%08lX %s\n", segName, sectName, (uint64_t)addr, typeName); - } - } - } -@@ -2080,7 +2080,7 @@ - pint_t thumb = 0; - if ( sym->n_desc() & N_ARM_THUMB_DEF ) - thumb = 1; -- printf("0x%08llX %s%s\n", sym->n_value()+thumb, flags, &fStrings[sym->n_strx()]); -+ printf("0x%08lX %s%s\n", sym->n_value()+thumb, flags, &fStrings[sym->n_strx()]); - } - } - } -@@ -2176,7 +2176,7 @@ - // To get the addend requires subtracting out the base address it was prebound to. - addend -= sym->n_value(); - } -- printf("%-8s %-16s 0x%08llX %10s %4s %5lld %-16s %s\n", segName, sectName, (uint64_t)addr, -+ printf("%-8s %-16s 0x%08lX %10s %4s %5ld %-16s %s\n", segName, sectName, (uint64_t)addr, - typeName, weak_import, addend, fromDylib, symbolName); - } - // look for non-lazy pointers -@@ -2203,7 +2203,7 @@ - const char* segName = segmentName(segIndex); - const char* sectName = sectionName(segIndex, addr); - int64_t addend = 0; -- printf("%-8s %-16s 0x%08llX %10s %4s %5lld %-16s %s\n", segName, sectName, (uint64_t)addr, -+ printf("%-8s %-16s 0x%08lX %10s %4s %5ld %-16s %s\n", segName, sectName, (uint64_t)addr, - typeName, weak_import, addend, fromDylib, symbolName); - } - } -@@ -2242,7 +2242,7 @@ - uint8_t segIndex = segmentIndexForAddress(addr); - const char* segName = segmentName(segIndex); - const char* sectName = sectionName(segIndex, addr); -- printf("%-7s %-16s 0x%08llX 0x%04X %-16s %s\n", segName, sectName, (uint64_t)addr, symbolIndex, fromDylib, symbolName); -+ printf("%-7s %-16s 0x%08lX 0x%04X %-16s %s\n", segName, sectName, (uint64_t)addr, symbolIndex, fromDylib, symbolName); - } - } - else if ( (type == S_SYMBOL_STUBS) && (((sect->flags() & S_ATTR_SELF_MODIFYING_CODE) != 0)) && (sect->reserved2() == 5) ) { -@@ -2259,7 +2259,7 @@ - uint8_t segIndex = segmentIndexForAddress(addr); - const char* segName = segmentName(segIndex); - const char* sectName = sectionName(segIndex, addr); -- printf("%-7s %-16s 0x%08llX 0x%04X %-16s %s\n", segName, sectName, (uint64_t)addr, symbolIndex, fromDylib, symbolName); -+ printf("%-7s %-16s 0x%08lX 0x%04X %-16s %s\n", segName, sectName, (uint64_t)addr, symbolIndex, fromDylib, symbolName); - } - } - } -diff -ur cctools-port-c1cc758/cctools/ld64/src/other/machochecker.cpp cctools-port-format/cctools/ld64/src/other/machochecker.cpp ---- cctools-port-c1cc758/cctools/ld64/src/other/machochecker.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/other/machochecker.cpp 2017-11-10 19:13:05.921592917 -0800 -@@ -639,12 +639,12 @@ - if ( threadInfo != NULL ) { - pint_t initialPC = getEntryPoint(threadInfo); - if ( (initialPC < fTEXTSegment->vmaddr()) || (initialPC >= (fTEXTSegment->vmaddr()+fTEXTSegment->vmsize())) ) -- throwf("entry point 0x%0llX is outside __TEXT segment", (long long)initialPC); -+ throwf("entry point 0x%0lX is outside __TEXT segment", (long long)initialPC); - } - else if ( entryPoint != NULL ) { - pint_t initialOffset = entryPoint->entryoff(); - if ( (initialOffset < fTEXTSegment->fileoff()) || (initialOffset >= (fTEXTSegment->fileoff()+fTEXTSegment->filesize())) ) -- throwf("entry point 0x%0llX is outside __TEXT segment", (long long)initialOffset); -+ throwf("entry point 0x%0lX is outside __TEXT segment", (long long)initialOffset); - } - - // checks for executables -@@ -1086,7 +1086,7 @@ - for (pint_t* p=arrayStart; p < arrayEnd; ++p) { - pint_t pointer = P::getP(*p); - if ( (pointer < fTEXTSegment->vmaddr()) || (pointer >= (fTEXTSegment->vmaddr()+fTEXTSegment->vmsize())) ) -- throwf("%s 0x%08llX points outside __TEXT segment", kind, (long long)pointer); -+ throwf("%s 0x%08lX points outside __TEXT segment", kind, (long long)pointer); - } - // check each pointer in array will be rebased and not bound - if ( fSlidableImage ) { -@@ -1094,9 +1094,9 @@ - pint_t sectionEndddr = sect->addr() + sect->size(); - for(pint_t addr = sectionBeginAddr; addr < sectionEndddr; addr += sizeof(pint_t)) { - if ( addressIsBindingSite(addr) ) -- throwf("%s at 0x%0llX has binding to external symbol", kind, (long long)addr); -+ throwf("%s at 0x%0lX has binding to external symbol", kind, (long long)addr); - if ( ! addressIsRebaseSite(addr) ) -- throwf("%s at 0x%0llX is not rebased", kind, (long long)addr); -+ throwf("%s at 0x%0lX is not rebased", kind, (long long)addr); - } - } - break; -@@ -1392,7 +1392,7 @@ - addr = segStartAddr+segOffset; - if ( (rangeStart <= addr) && (addr < rangeEnd) ) - return true; -- //printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ //printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += sizeof(pint_t); - } - break; -@@ -1402,7 +1402,7 @@ - addr = segStartAddr+segOffset; - if ( (rangeStart <= addr) && (addr < rangeEnd) ) - return true; -- //printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ //printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += sizeof(pint_t); - } - break; -@@ -1410,7 +1410,7 @@ - addr = segStartAddr+segOffset; - if ( (rangeStart <= addr) && (addr < rangeEnd) ) - return true; -- //printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ //printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += read_uleb128(p, end) + sizeof(pint_t); - break; - case REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB: -@@ -1420,7 +1420,7 @@ - addr = segStartAddr+segOffset; - if ( (rangeStart <= addr) && (addr < rangeEnd) ) - return true; -- //printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ //printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += skip + sizeof(pint_t); - } - break; -@@ -1482,7 +1482,7 @@ - addr = segStartAddr+segOffset; - if ( addr == targetAddr ) - return true; -- //printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ //printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += sizeof(pint_t); - } - break; -@@ -1492,7 +1492,7 @@ - addr = segStartAddr+segOffset; - if ( addr == targetAddr ) - return true; -- //printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ //printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += sizeof(pint_t); - } - break; -@@ -1500,7 +1500,7 @@ - addr = segStartAddr+segOffset; - if ( addr == targetAddr ) - return true; -- //printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ //printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += read_uleb128(p, end) + sizeof(pint_t); - break; - case REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB: -@@ -1510,7 +1510,7 @@ - addr = segStartAddr+segOffset; - if ( addr == targetAddr ) - return true; -- //printf("%-7s %-16s 0x%08llX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); -+ //printf("%-7s %-16s 0x%08lX %s\n", segName, sectionName(segIndex, segStartAddr+segOffset), segStartAddr+segOffset, typeName); - segOffset += skip + sizeof(pint_t); - } - break; -diff -ur cctools-port-c1cc758/cctools/ld64/src/other/ObjectDump.cpp cctools-port-format/cctools/ld64/src/other/ObjectDump.cpp ---- cctools-port-c1cc758/cctools/ld64/src/other/ObjectDump.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/other/ObjectDump.cpp 2017-11-10 19:13:05.921592917 -0800 -@@ -630,7 +630,7 @@ - } - else { - uint64_t sectAddr = addressOfFirstAtomInSection(atom.section()); -- sprintf(buffer, "%s@%s+0x%08llX", atom.name(), atom.section().sectionName(), atom.objectAddress()-sectAddr); -+ sprintf(buffer, "%s@%s+0x%08lX", atom.name(), atom.section().sectionName(), atom.objectAddress()-sectAddr); - } - break; - case ld::Atom::symbolTableNotInFinalLinkedImages: -@@ -704,10 +704,10 @@ - printf(" - %s", referenceTargetAtomName(ref)); - break; - case ld::Fixup::kindAddAddend: -- printf(" + 0x%llX", ref->u.addend); -+ printf(" + 0x%lX", ref->u.addend); - break; - case ld::Fixup::kindSubtractAddend: -- printf(" - 0x%llX", ref->u.addend); -+ printf(" - 0x%lX", ref->u.addend); - break; - case ld::Fixup::kindSetTargetImageOffset: - printf("imageOffset(%s)", referenceTargetAtomName(ref)); -@@ -1063,7 +1063,7 @@ - void dumper::dumpAtom(const ld::Atom& atom) - { - printf("name: %s\n", makeName(atom)); -- printf("size: 0x%0llX\n", atom.size()); -+ printf("size: 0x%0lX\n", atom.size()); - printf("align: %u mod %u\n", atom.alignment().modulus, (1 << atom.alignment().powerOf2) ); - printf("scope: %s\n", scopeString(atom)); - if ( sShowDefinitionKind ) -diff -ur cctools-port-c1cc758/cctools/ld64/src/other/rebase.cpp cctools-port-format/cctools/ld64/src/other/rebase.cpp ---- cctools-port-c1cc758/cctools/ld64/src/other/rebase.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/other/rebase.cpp 2017-11-10 19:13:05.921592917 -0800 -@@ -454,7 +454,7 @@ - template - void Rebaser::rebaseAt(int segIndex, uint64_t offset, uint8_t type) - { -- //fprintf(stderr, "rebaseAt(seg=%d, offset=0x%08llX, type=%d\n", segIndex, offset, type); -+ //fprintf(stderr, "rebaseAt(seg=%d, offset=0x%08lX, type=%d\n", segIndex, offset, type); - static int lastSegIndex = -1; - static uint8_t* lastSegMappedStart = NULL; - if ( segIndex != lastSegIndex ) { -@@ -857,7 +857,7 @@ - ai.vmSize = rebaser->getVMSize(); - ai.orgBase = rebaser->getBaseAddress(); - ai.newBase = 0; -- //fprintf(stderr, "base=0x%llX, size=0x%llX\n", ai.orgBase, ai.vmSize); -+ //fprintf(stderr, "base=0x%lX, size=0x%lX\n", ai.orgBase, ai.vmSize); - info.archs.push_back(ai); - } - } -@@ -903,7 +903,7 @@ - if ( (*rit)->getArchitecture() == fait->arch ) { - (*rit)->setBaseAddress(fait->newBase); - if ( verbose ) -- printf("%8s 0x%0llX -> 0x%0llX %s\n", nameForArch(fait->arch), fait->orgBase, fait->newBase, info.path); -+ printf("%8s 0x%0lX -> 0x%0lX %s\n", nameForArch(fait->arch), fait->orgBase, fait->newBase, info.path); - } - } - } -diff -ur cctools-port-c1cc758/cctools/ld64/src/other/unwinddump.cpp cctools-port-format/cctools/ld64/src/other/unwinddump.cpp ---- cctools-port-c1cc758/cctools/ld64/src/other/unwinddump.cpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/ld64/src/other/unwinddump.cpp 2017-11-10 19:13:05.924926282 -0800 -@@ -250,7 +250,7 @@ - value |= 1; - if ( value == addr ) { - const char* r = &fStrings[fSymbols[i].n_strx()]; -- //fprintf(stderr, "addr=0x%08llX, i=%u, n_type=0x%0X, r=%s\n", (long long)(fSymbols[i].n_value()), i, fSymbols[i].n_type(), r); -+ //fprintf(stderr, "addr=0x%08lX, i=%u, n_type=0x%0X, r=%s\n", (long long)(fSymbols[i].n_value()), i, fSymbols[i].n_type(), r); - return r; - } - else if ( offset != NULL ) { -@@ -904,14 +904,14 @@ - template - void UnwindPrinter::printObjectUnwindSection(bool showFunctionNames) - { -- printf("Arch: %s, Section: __LD,__compact_unwind (size=0x%08llX, => %lld entries)\n", -+ printf("Arch: %s, Section: __LD,__compact_unwind (size=0x%08lX, => %ld entries)\n", - archName(), fUnwindSection->size(), fUnwindSection->size() / sizeof(macho_compact_unwind_entry

)); - - const macho_compact_unwind_entry

* const entriesStart = (macho_compact_unwind_entry

*)((uint8_t*)fHeader + fUnwindSection->offset()); - const macho_compact_unwind_entry

* const entriesEnd = (macho_compact_unwind_entry

*)((uint8_t*)fHeader + fUnwindSection->offset() + fUnwindSection->size()); - for (const macho_compact_unwind_entry

* entry=entriesStart; entry < entriesEnd; ++entry) { - uint64_t entryAddress = ((char*)entry - (char*)entriesStart) + fUnwindSection->addr(); -- printf("0x%08llX:\n", entryAddress); -+ printf("0x%08lX:\n", entryAddress); - const char* functionNameStr; - pint_t funcAddress; - uint32_t offsetInFunction; -@@ -923,11 +923,11 @@ - funcAddress = entry->codeStart(); - } - if ( offsetInFunction == 0 ) -- printf(" start: 0x%08llX %s\n", (uint64_t)funcAddress, functionNameStr); -+ printf(" start: 0x%08lX %s\n", (uint64_t)funcAddress, functionNameStr); - else -- printf(" start: 0x%08llX %s+0x%X\n", (uint64_t)funcAddress+offsetInFunction, functionNameStr, offsetInFunction); -+ printf(" start: 0x%08lX %s+0x%X\n", (uint64_t)funcAddress+offsetInFunction, functionNameStr, offsetInFunction); - -- printf(" end: 0x%08llX (len=0x%08X)\n", (uint64_t)(funcAddress+offsetInFunction+entry->codeLen()), entry->codeLen()); -+ printf(" end: 0x%08lX (len=0x%08X)\n", (uint64_t)(funcAddress+offsetInFunction+entry->codeLen()), entry->codeLen()); - - char encodingString[200]; - this->decode(entry->compactUnwindInfo(), ((const uint8_t*)fHeader), encodingString); -@@ -947,9 +947,9 @@ - uint32_t lsdaOffset; - const char* lsdaName = this->functionName(entry->lsda(), &lsdaOffset); - if ( lsdaOffset == 0 ) -- printf(" lsda: 0x%08llX %s\n", (uint64_t)entry->lsda(), lsdaName); -+ printf(" lsda: 0x%08lX %s\n", (uint64_t)entry->lsda(), lsdaName); - else -- printf(" lsda: 0x%08llX %s+0x%X\n", (uint64_t)entry->lsda(), lsdaName, lsdaOffset); -+ printf(" lsda: 0x%08lX %s+0x%X\n", (uint64_t)entry->lsda(), lsdaName, lsdaOffset); - } - } - } -@@ -962,7 +962,7 @@ - const uint8_t* sectionContent = (uint8_t*)fHeader + fUnwindSection->offset(); - macho_unwind_info_section_header

* sectionHeader = (macho_unwind_info_section_header

*)(sectionContent); - -- printf("Arch: %s, Section: __TEXT,__unwind_info (addr=0x%08llX, size=0x%08llX, fileOffset=0x%08X)\n", -+ printf("Arch: %s, Section: __TEXT,__unwind_info (addr=0x%08lX, size=0x%08lX, fileOffset=0x%08X)\n", - archName(), fUnwindSection->addr(), fUnwindSection->size(), fUnwindSection->offset()); - printf("\tversion=0x%08X\n", sectionHeader->version()); - printf("\tcommonEncodingsArraySectionOffset=0x%08X\n", sectionHeader->commonEncodingsArraySectionOffset()); -diff -ur cctools-port-c1cc758/cctools/libstuff/ofile.c cctools-port-format/cctools/libstuff/ofile.c ---- cctools-port-c1cc758/cctools/libstuff/ofile.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/libstuff/ofile.c 2017-11-10 19:38:34.511211634 -0800 -@@ -3108,7 +3108,7 @@ - } - if(offset % - (1 << align) != 0){ -- error("fat file: %s offset: %llu for cputype (%d) cpusubtype " -+ error("fat file: %s offset: %lu for cputype (%d) cpusubtype " - "(%d)) not aligned on it's alignment (2^%u)", - ofile->file_name, offset, cputype, - cpusubtype & ~CPU_SUBTYPE_MASK, align); -@@ -3210,7 +3210,7 @@ - return(CHECK_BAD); - } - if(offset % (1 << align) != 0){ -- archive_member_error(ofile, "fat file's offset: %llu for " -+ archive_member_error(ofile, "fat file's offset: %lu for " - "cputype (%d) cpusubtype (%d) not aligned on it's " - "alignment (2^%u)", offset, cputype, - cpusubtype & ~CPU_SUBTYPE_MASK, align); -diff -ur cctools-port-c1cc758/cctools/libstuff/writeout.c cctools-port-format/cctools/libstuff/writeout.c ---- cctools-port-c1cc758/cctools/libstuff/writeout.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-format/cctools/libstuff/writeout.c 2017-11-10 19:40:56.792695079 -0800 -@@ -421,7 +421,7 @@ - if((r = vm_allocate(mach_task_self(), (vm_address_t *)&file, - file_size, TRUE)) != KERN_SUCCESS) - mach_fatal(r, "can't vm_allocate() buffer for output file: %s of " -- "size %llu", filename, file_size); -+ "size %lu", filename, file_size); - - /* - * If there is more than one architecture then fill in the fat file -@@ -460,7 +460,7 @@ - if(offset > UINT32_MAX && archs[i].fat_arch64 == NULL){ - error("file too large to create as a fat file because " - "offset field in struct fat_arch is only 32-bits and " -- "offset (%llu) to architecture %s exceeds that", -+ "offset (%lu) to architecture %s exceeds that", - offset, archs[i].fat_arch_name); - return; - } -diff -ur cctools-port-c1cc758/cctools/misc/libtool.c cctools-port-format/cctools/misc/libtool.c ---- cctools-port-c1cc758/cctools/misc/libtool.c 2017-11-10 19:22:01.790476705 -0800 -+++ cctools-port-format/cctools/misc/libtool.c 2017-11-10 19:24:48.435607249 -0800 -@@ -2545,7 +2545,7 @@ - if((r = vm_allocate(mach_task_self(), (vm_address_t *)&library, - library_size, TRUE)) != KERN_SUCCESS) - mach_fatal(r, "can't vm_allocate() buffer for output file: %s " -- "of size %llu", output, library_size); -+ "of size %lu", output, library_size); - - - /* put in the archive magic string in the buffer */ -@@ -2581,7 +2581,7 @@ - if((r = vm_allocate(mach_task_self(), (vm_address_t *)&library, - library_size, TRUE)) != KERN_SUCCESS) - mach_fatal(r, "can't vm_allocate() buffer for output file: %s of " -- "size %llu", output, library_size); -+ "size %lu", output, library_size); - - /* - * Create the output file. The unlink() is done to handle the problem -@@ -2635,7 +2635,7 @@ - if(cmd_flags.fat64 == FALSE && offset > UINT32_MAX) - error("file too large to create as a fat file because " - "offset field in struct fat_arch is only 32-bits and " -- "offset (%llu) to architecture %s exceeds that", -+ "offset (%lu) to architecture %s exceeds that", - offset, archs[i].arch_flag.name); - if(archs[i].arch_flag.cputype & CPU_ARCH_ABI64){ - if(cmd_flags.fat64 == TRUE) -@@ -2660,7 +2660,7 @@ - if(cmd_flags.fat64 == FALSE && archs[i].size > UINT32_MAX) - error("file too large to create as a fat file because " - "size field in struct fat_arch is only 32-bits and " -- "size (%llu) of architecture %s exceeds that", -+ "size (%lu) of architecture %s exceeds that", - archs[i].size, archs[i].arch_flag.name); - if(cmd_flags.fat64 == TRUE) - fat_arch64[i].size = archs[i].size; -@@ -3043,15 +3043,15 @@ - return; - - if(offset + size > library_size) -- fatal("internal error: output_flush(offset = %llu, size = %llu) " -- "out of range for library_size = %llu", offset, size, -+ fatal("internal error: output_flush(offset = %lu, size = %lu) " -+ "out of range for library_size = %lu", offset, size, - library_size); - - #ifdef DEBUG - if(cmd_flags.debug & (1 << 2)) - print_block_list(); - if(cmd_flags.debug & (1 << 1)) -- printf("output_flush(offset = %llu, size %llu)", offset, size); -+ printf("output_flush(offset = %lu, size %lu)", offset, size); - #endif /* DEBUG */ - - if(size == 0){ -@@ -3087,9 +3087,9 @@ - */ - if(before != NULL){ - if(before->offset + before->size > offset){ -- warning("internal error: output_flush(offset = %llu, size = " -- "%llu) overlaps with flushed block(offset = %llu, " -- "size = %llu)", offset, size, before->offset, -+ warning("internal error: output_flush(offset = %lu, size = " -+ "%lu) overlaps with flushed block(offset = %lu, " -+ "size = %lu)", offset, size, before->offset, - before->size); - printf("calling abort()\n"); - abort(); -@@ -3097,9 +3097,9 @@ - } - if(after != NULL){ - if(offset + size > after->offset){ -- warning("internal error: output_flush(offset = %llu, size = " -- "%llu) overlaps with flushed block(offset = %llu, " -- "size = %llu)", offset, size, after->offset, -+ warning("internal error: output_flush(offset = %lu, size = " -+ "%lu) overlaps with flushed block(offset = %lu, " -+ "size = %lu)", offset, size, after->offset, - after->size); - printf("calling abort()\n"); - abort(); diff --git a/nix/nixcrpkgs/macos/cctools-ld64-registers.patch b/nix/nixcrpkgs/macos/cctools-ld64-registers.patch deleted file mode 100644 index 70963e253c..0000000000 --- a/nix/nixcrpkgs/macos/cctools-ld64-registers.patch +++ /dev/null @@ -1,299 +0,0 @@ -diff -ur cctools-port-c1cc758/cctools/ld64/src/ld/parsers/libunwind/Registers.hpp cctools-port-patched/cctools/ld64/src/ld/parsers/libunwind/Registers.hpp ---- cctools-port-c1cc758/cctools/ld64/src/ld/parsers/libunwind/Registers.hpp 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-patched/cctools/ld64/src/ld/parsers/libunwind/Registers.hpp 2017-10-29 10:12:23.150301208 -0700 -@@ -72,22 +72,22 @@ - const char* getRegisterName(int num); - void jumpto(); - -- uint32_t getSP() const { return fRegisters.__esp; } -- void setSP(uint32_t value) { fRegisters.__esp = value; } -- uint32_t getIP() const { return fRegisters.__eip; } -- void setIP(uint32_t value) { fRegisters.__eip = value; } -- uint32_t getEBP() const { return fRegisters.__ebp; } -- void setEBP(uint32_t value) { fRegisters.__ebp = value; } -- uint32_t getEBX() const { return fRegisters.__ebx; } -- void setEBX(uint32_t value) { fRegisters.__ebx = value; } -- uint32_t getECX() const { return fRegisters.__ecx; } -- void setECX(uint32_t value) { fRegisters.__ecx = value; } -- uint32_t getEDX() const { return fRegisters.__edx; } -- void setEDX(uint32_t value) { fRegisters.__edx = value; } -- uint32_t getESI() const { return fRegisters.__esi; } -- void setESI(uint32_t value) { fRegisters.__esi = value; } -- uint32_t getEDI() const { return fRegisters.__edi; } -- void setEDI(uint32_t value) { fRegisters.__edi = value; } -+ uint32_t getSP() const { return fRegisters.esp; } -+ void setSP(uint32_t value) { fRegisters.esp = value; } -+ uint32_t getIP() const { return fRegisters.eip; } -+ void setIP(uint32_t value) { fRegisters.eip = value; } -+ uint32_t getEBP() const { return fRegisters.ebp; } -+ void setEBP(uint32_t value) { fRegisters.ebp = value; } -+ uint32_t getEBX() const { return fRegisters.ebx; } -+ void setEBX(uint32_t value) { fRegisters.ebx = value; } -+ uint32_t getECX() const { return fRegisters.ecx; } -+ void setECX(uint32_t value) { fRegisters.ecx = value; } -+ uint32_t getEDX() const { return fRegisters.edx; } -+ void setEDX(uint32_t value) { fRegisters.edx = value; } -+ uint32_t getESI() const { return fRegisters.esi; } -+ void setESI(uint32_t value) { fRegisters.esi = value; } -+ uint32_t getEDI() const { return fRegisters.edi; } -+ void setEDI(uint32_t value) { fRegisters.edi = value; } - - private: - i386_thread_state_t fRegisters; -@@ -122,25 +122,25 @@ - { - switch ( regNum ) { - case UNW_REG_IP: -- return fRegisters.__eip; -+ return fRegisters.eip; - case UNW_REG_SP: -- return fRegisters.__esp; -+ return fRegisters.esp; - case UNW_X86_EAX: -- return fRegisters.__eax; -+ return fRegisters.eax; - case UNW_X86_ECX: -- return fRegisters.__ecx; -+ return fRegisters.ecx; - case UNW_X86_EDX: -- return fRegisters.__edx; -+ return fRegisters.edx; - case UNW_X86_EBX: -- return fRegisters.__ebx; -+ return fRegisters.ebx; - case UNW_X86_EBP: -- return fRegisters.__ebp; -+ return fRegisters.ebp; - case UNW_X86_ESP: -- return fRegisters.__esp; -+ return fRegisters.esp; - case UNW_X86_ESI: -- return fRegisters.__esi; -+ return fRegisters.esi; - case UNW_X86_EDI: -- return fRegisters.__edi; -+ return fRegisters.edi; - } - ABORT("unsupported x86 register"); - } -@@ -149,34 +149,34 @@ - { - switch ( regNum ) { - case UNW_REG_IP: -- fRegisters.__eip = value; -+ fRegisters.eip = value; - return; - case UNW_REG_SP: -- fRegisters.__esp = value; -+ fRegisters.esp = value; - return; - case UNW_X86_EAX: -- fRegisters.__eax = value; -+ fRegisters.eax = value; - return; - case UNW_X86_ECX: -- fRegisters.__ecx = value; -+ fRegisters.ecx = value; - return; - case UNW_X86_EDX: -- fRegisters.__edx = value; -+ fRegisters.edx = value; - return; - case UNW_X86_EBX: -- fRegisters.__ebx = value; -+ fRegisters.ebx = value; - return; - case UNW_X86_EBP: -- fRegisters.__ebp = value; -+ fRegisters.ebp = value; - return; - case UNW_X86_ESP: -- fRegisters.__esp = value; -+ fRegisters.esp = value; - return; - case UNW_X86_ESI: -- fRegisters.__esi = value; -+ fRegisters.esi = value; - return; - case UNW_X86_EDI: -- fRegisters.__edi = value; -+ fRegisters.edi = value; - return; - } - ABORT("unsupported x86 register"); -@@ -253,22 +253,22 @@ - void setVectorRegister(int num, v128 value); - const char* getRegisterName(int num); - void jumpto(); -- uint64_t getSP() const { return fRegisters.__rsp; } -- void setSP(uint64_t value) { fRegisters.__rsp = value; } -- uint64_t getIP() const { return fRegisters.__rip; } -- void setIP(uint64_t value) { fRegisters.__rip = value; } -- uint64_t getRBP() const { return fRegisters.__rbp; } -- void setRBP(uint64_t value) { fRegisters.__rbp = value; } -- uint64_t getRBX() const { return fRegisters.__rbx; } -- void setRBX(uint64_t value) { fRegisters.__rbx = value; } -- uint64_t getR12() const { return fRegisters.__r12; } -- void setR12(uint64_t value) { fRegisters.__r12 = value; } -- uint64_t getR13() const { return fRegisters.__r13; } -- void setR13(uint64_t value) { fRegisters.__r13 = value; } -- uint64_t getR14() const { return fRegisters.__r14; } -- void setR14(uint64_t value) { fRegisters.__r14 = value; } -- uint64_t getR15() const { return fRegisters.__r15; } -- void setR15(uint64_t value) { fRegisters.__r15 = value; } -+ uint64_t getSP() const { return fRegisters.rsp; } -+ void setSP(uint64_t value) { fRegisters.rsp = value; } -+ uint64_t getIP() const { return fRegisters.rip; } -+ void setIP(uint64_t value) { fRegisters.rip = value; } -+ uint64_t getRBP() const { return fRegisters.rbp; } -+ void setRBP(uint64_t value) { fRegisters.rbp = value; } -+ uint64_t getRBX() const { return fRegisters.rbx; } -+ void setRBX(uint64_t value) { fRegisters.rbx = value; } -+ uint64_t getR12() const { return fRegisters.r12; } -+ void setR12(uint64_t value) { fRegisters.r12 = value; } -+ uint64_t getR13() const { return fRegisters.r13; } -+ void setR13(uint64_t value) { fRegisters.r13 = value; } -+ uint64_t getR14() const { return fRegisters.r14; } -+ void setR14(uint64_t value) { fRegisters.r14 = value; } -+ uint64_t getR15() const { return fRegisters.r15; } -+ void setR15(uint64_t value) { fRegisters.r15 = value; } - private: - x86_thread_state64_t fRegisters; - }; -@@ -302,41 +302,41 @@ - { - switch ( regNum ) { - case UNW_REG_IP: -- return fRegisters.__rip; -+ return fRegisters.rip; - case UNW_REG_SP: -- return fRegisters.__rsp; -+ return fRegisters.rsp; - case UNW_X86_64_RAX: -- return fRegisters.__rax; -+ return fRegisters.rax; - case UNW_X86_64_RDX: -- return fRegisters.__rdx; -+ return fRegisters.rdx; - case UNW_X86_64_RCX: -- return fRegisters.__rcx; -+ return fRegisters.rcx; - case UNW_X86_64_RBX: -- return fRegisters.__rbx; -+ return fRegisters.rbx; - case UNW_X86_64_RSI: -- return fRegisters.__rsi; -+ return fRegisters.rsi; - case UNW_X86_64_RDI: -- return fRegisters.__rdi; -+ return fRegisters.rdi; - case UNW_X86_64_RBP: -- return fRegisters.__rbp; -+ return fRegisters.rbp; - case UNW_X86_64_RSP: -- return fRegisters.__rsp; -+ return fRegisters.rsp; - case UNW_X86_64_R8: -- return fRegisters.__r8; -+ return fRegisters.r8; - case UNW_X86_64_R9: -- return fRegisters.__r9; -+ return fRegisters.r9; - case UNW_X86_64_R10: -- return fRegisters.__r10; -+ return fRegisters.r10; - case UNW_X86_64_R11: -- return fRegisters.__r11; -+ return fRegisters.r11; - case UNW_X86_64_R12: -- return fRegisters.__r12; -+ return fRegisters.r12; - case UNW_X86_64_R13: -- return fRegisters.__r13; -+ return fRegisters.r13; - case UNW_X86_64_R14: -- return fRegisters.__r14; -+ return fRegisters.r14; - case UNW_X86_64_R15: -- return fRegisters.__r15; -+ return fRegisters.r15; - } - ABORT("unsupported x86_64 register"); - } -@@ -345,58 +345,58 @@ - { - switch ( regNum ) { - case UNW_REG_IP: -- fRegisters.__rip = value; -+ fRegisters.rip = value; - return; - case UNW_REG_SP: -- fRegisters.__rsp = value; -+ fRegisters.rsp = value; - return; - case UNW_X86_64_RAX: -- fRegisters.__rax = value; -+ fRegisters.rax = value; - return; - case UNW_X86_64_RDX: -- fRegisters.__rdx = value; -+ fRegisters.rdx = value; - return; - case UNW_X86_64_RCX: -- fRegisters.__rcx = value; -+ fRegisters.rcx = value; - return; - case UNW_X86_64_RBX: -- fRegisters.__rbx = value; -+ fRegisters.rbx = value; - return; - case UNW_X86_64_RSI: -- fRegisters.__rsi = value; -+ fRegisters.rsi = value; - return; - case UNW_X86_64_RDI: -- fRegisters.__rdi = value; -+ fRegisters.rdi = value; - return; - case UNW_X86_64_RBP: -- fRegisters.__rbp = value; -+ fRegisters.rbp = value; - return; - case UNW_X86_64_RSP: -- fRegisters.__rsp = value; -+ fRegisters.rsp = value; - return; - case UNW_X86_64_R8: -- fRegisters.__r8 = value; -+ fRegisters.r8 = value; - return; - case UNW_X86_64_R9: -- fRegisters.__r9 = value; -+ fRegisters.r9 = value; - return; - case UNW_X86_64_R10: -- fRegisters.__r10 = value; -+ fRegisters.r10 = value; - return; - case UNW_X86_64_R11: -- fRegisters.__r11 = value; -+ fRegisters.r11 = value; - return; - case UNW_X86_64_R12: -- fRegisters.__r12 = value; -+ fRegisters.r12 = value; - return; - case UNW_X86_64_R13: -- fRegisters.__r13 = value; -+ fRegisters.r13 = value; - return; - case UNW_X86_64_R14: -- fRegisters.__r14 = value; -+ fRegisters.r14 = value; - return; - case UNW_X86_64_R15: -- fRegisters.__r15 = value; -+ fRegisters.r15 = value; - return; - } - ABORT("unsupported x86_64 register"); diff --git a/nix/nixcrpkgs/macos/cctools-libstuff-no-error.patch b/nix/nixcrpkgs/macos/cctools-libstuff-no-error.patch deleted file mode 100644 index 6be415388f..0000000000 --- a/nix/nixcrpkgs/macos/cctools-libstuff-no-error.patch +++ /dev/null @@ -1,93 +0,0 @@ -diff -ur cctools-port-c1cc758/cctools/include/stuff/errors.h cctools-port-libstuff-no-error/cctools/include/stuff/errors.h ---- cctools-port-c1cc758/cctools/include/stuff/errors.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-libstuff-no-error/cctools/include/stuff/errors.h 2017-11-10 21:52:54.172522281 -0800 -@@ -40,7 +40,7 @@ - __attribute__ ((format (printf, 1, 2))) - #endif - __attribute__((visibility("hidden"))); --extern void error( -+extern void errorf( - const char *format, ...) - #ifdef __GNUC__ - __attribute__ ((format (printf, 1, 2))) -diff -ur cctools-port-c1cc758/cctools/libstuff/errors.c cctools-port-libstuff-no-error/cctools/libstuff/errors.c ---- cctools-port-c1cc758/cctools/libstuff/errors.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-libstuff-no-error/cctools/libstuff/errors.c 2017-11-10 21:52:42.795730237 -0800 -@@ -57,7 +57,7 @@ - */ - __private_extern__ - void --error( -+errorf( - const char *format, - ...) - { -diff -ur cctools-port-c1cc758/cctools/libstuff/ofile.c cctools-port-libstuff-no-error/cctools/libstuff/ofile.c ---- cctools-port-c1cc758/cctools/libstuff/ofile.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-libstuff-no-error/cctools/libstuff/ofile.c 2017-11-10 21:54:20.156803208 -0800 -@@ -115,6 +115,8 @@ - }; - #endif /* !defined(OTOOL) */ - -+#define error errorf -+ - static enum bool ofile_specific_arch( - struct ofile *ofile, - uint32_t narch); -diff -ur cctools-port-c1cc758/cctools/libstuff/swap_headers.c cctools-port-libstuff-no-error/cctools/libstuff/swap_headers.c ---- cctools-port-c1cc758/cctools/libstuff/swap_headers.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-libstuff-no-error/cctools/libstuff/swap_headers.c 2017-11-10 21:54:49.873797374 -0800 -@@ -50,6 +50,8 @@ - #include "stuff/bytesex.h" - #include "stuff/errors.h" - -+#define error errorf -+ - /* - * swap_object_headers() swaps the object file headers from the host byte sex - * into the non-host byte sex. It returns TRUE if it can and did swap the -diff -ur cctools-port-c1cc758/cctools/libstuff/SymLoc.c cctools-port-libstuff-no-error/cctools/libstuff/SymLoc.c ---- cctools-port-c1cc758/cctools/libstuff/SymLoc.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-libstuff-no-error/cctools/libstuff/SymLoc.c 2017-11-10 21:53:06.199321490 -0800 -@@ -118,7 +118,7 @@ - if(fclose(file) != 0) - system_error("fclose() failed"); - if (!*viewPath) { -- error("symLocForDylib(): Can't locate view path for release %s", -+ errorf("symLocForDylib(): Can't locate view path for release %s", - releaseName); - return NULL; - } -@@ -252,7 +252,7 @@ - // process return value - if (!c) { - if(no_error_if_missing == FALSE) -- error("Can't find project that builds %s", installName); -+ errorf("Can't find project that builds %s", installName); - return NULL; - } else { - *found_project = TRUE; -diff -ur cctools-port-c1cc758/cctools/libstuff/version_number.c cctools-port-libstuff-no-error/cctools/libstuff/version_number.c ---- cctools-port-c1cc758/cctools/libstuff/version_number.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-libstuff-no-error/cctools/libstuff/version_number.c 2017-11-10 21:55:18.674114769 -0800 -@@ -27,6 +27,8 @@ - #include "stuff/allocate.h" - #include "stuff/errors.h" - -+#define error errorf -+ - /* - * get_version_number() converts an ascii version number string of the form: - * X[.Y[.Z]] -diff -ur cctools-port-c1cc758/cctools/libstuff/writeout.c cctools-port-libstuff-no-error/cctools/libstuff/writeout.c ---- cctools-port-c1cc758/cctools/libstuff/writeout.c 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-libstuff-no-error/cctools/libstuff/writeout.c 2017-11-10 21:55:43.537722114 -0800 -@@ -37,6 +37,8 @@ - #include "stuff/lto.h" - #endif /* LTO_SUPPORT */ - -+#define error errorf -+ - static void copy_new_symbol_info( - char *p, - uint32_t *size, diff --git a/nix/nixcrpkgs/macos/cctools-private-extern.patch b/nix/nixcrpkgs/macos/cctools-private-extern.patch deleted file mode 100644 index ce0f099fdf..0000000000 --- a/nix/nixcrpkgs/macos/cctools-private-extern.patch +++ /dev/null @@ -1,271 +0,0 @@ -diff -ur cctools-port-c1cc758/cctools/include/foreign/extern.h cctools-port-private-extern/cctools/include/foreign/extern.h ---- cctools-port-c1cc758/cctools/include/foreign/extern.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/foreign/extern.h 2017-11-10 18:32:37.035890924 -0800 -@@ -1 +1,2 @@ -+#pragma once - #define __private_extern__ __attribute__((visibility("hidden"))) -diff -ur cctools-port-c1cc758/cctools/include/mach-o/dyld.h cctools-port-private-extern/cctools/include/mach-o/dyld.h ---- cctools-port-c1cc758/cctools/include/mach-o/dyld.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/mach-o/dyld.h 2017-11-10 18:32:37.035890924 -0800 -@@ -27,9 +27,7 @@ - extern "C" { - #endif /* __cplusplus */ - --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+#include - - #include - #include -diff -ur cctools-port-c1cc758/cctools/include/stuff/allocate.h cctools-port-private-extern/cctools/include/stuff/allocate.h ---- cctools-port-c1cc758/cctools/include/stuff/allocate.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/allocate.h 2017-11-10 18:33:52.006780029 -0800 -@@ -20,9 +20,8 @@ - * - * @APPLE_LICENSE_HEADER_END@ - */ --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+ -+#include - - /* defined in allocate.c */ - -diff -ur cctools-port-c1cc758/cctools/include/stuff/arch.h cctools-port-private-extern/cctools/include/stuff/arch.h ---- cctools-port-c1cc758/cctools/include/stuff/arch.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/arch.h 2017-11-10 18:34:36.487305108 -0800 -@@ -23,9 +23,8 @@ - #ifndef _STUFF_ARCH_H_ - #define _STUFF_ARCH_H_ - --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+#include -+ - /* - * This file contains the current known set of flags and constants for the - * known architectures. -diff -ur cctools-port-c1cc758/cctools/include/stuff/best_arch.h cctools-port-private-extern/cctools/include/stuff/best_arch.h ---- cctools-port-c1cc758/cctools/include/stuff/best_arch.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/best_arch.h 2017-11-10 18:34:48.764116432 -0800 -@@ -20,9 +20,8 @@ - * - * @APPLE_LICENSE_HEADER_END@ - */ --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+ -+#include - - #include - #include -diff -ur cctools-port-c1cc758/cctools/include/stuff/breakout.h cctools-port-private-extern/cctools/include/stuff/breakout.h ---- cctools-port-c1cc758/cctools/include/stuff/breakout.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/breakout.h 2017-11-10 18:35:04.334299743 -0800 -@@ -20,9 +20,8 @@ - * - * @APPLE_LICENSE_HEADER_END@ - */ --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+ -+#include - - #import "stuff/ofile.h" - -diff -ur cctools-port-c1cc758/cctools/include/stuff/bytesex.h cctools-port-private-extern/cctools/include/stuff/bytesex.h ---- cctools-port-c1cc758/cctools/include/stuff/bytesex.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/bytesex.h 2017-11-10 18:35:12.637730768 -0800 -@@ -29,9 +29,7 @@ - #ifndef _STUFF_BYTESEX_H_ - #define _STUFF_BYTESEX_H_ - --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+#include - - #include - #include -diff -ur cctools-port-c1cc758/cctools/include/stuff/execute.h cctools-port-private-extern/cctools/include/stuff/execute.h ---- cctools-port-c1cc758/cctools/include/stuff/execute.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/execute.h 2017-11-10 18:35:34.417986815 -0800 -@@ -20,9 +20,8 @@ - * - * @APPLE_LICENSE_HEADER_END@ - */ --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+ -+#include - - /* - * execute() does an execvp using the argv passed to it. If the parameter -diff -ur cctools-port-c1cc758/cctools/include/stuff/guess_short_name.h cctools-port-private-extern/cctools/include/stuff/guess_short_name.h ---- cctools-port-c1cc758/cctools/include/stuff/guess_short_name.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/guess_short_name.h 2017-11-10 18:40:11.801171715 -0800 -@@ -22,6 +22,8 @@ - */ - #include "stuff/bool.h" - -+#include -+ - __private_extern__ char * guess_short_name( - char *name, - enum bool *is_framework, -diff -ur cctools-port-c1cc758/cctools/include/stuff/hash_string.h cctools-port-private-extern/cctools/include/stuff/hash_string.h ---- cctools-port-c1cc758/cctools/include/stuff/hash_string.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/hash_string.h 2017-11-10 18:35:43.698095826 -0800 -@@ -20,9 +20,8 @@ - * - * @APPLE_LICENSE_HEADER_END@ - */ --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+ -+#include - - __private_extern__ int32_t hash_string( - char *key); -diff -ur cctools-port-c1cc758/cctools/include/stuff/hppa.h cctools-port-private-extern/cctools/include/stuff/hppa.h ---- cctools-port-c1cc758/cctools/include/stuff/hppa.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/hppa.h 2017-11-10 18:36:01.414970472 -0800 -@@ -20,9 +20,8 @@ - * - * @APPLE_LICENSE_HEADER_END@ - */ --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+ -+#include - - __private_extern__ void calc_hppa_HILO( - uint32_t base, -diff -ur cctools-port-c1cc758/cctools/include/stuff/lto.h cctools-port-private-extern/cctools/include/stuff/lto.h ---- cctools-port-c1cc758/cctools/include/stuff/lto.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/lto.h 2017-11-10 18:40:27.811342692 -0800 -@@ -3,6 +3,8 @@ - - #include "stuff/arch.h" - -+#include -+ - #ifdef LTO_SUPPORT - - __private_extern__ int is_llvm_bitcode_from_memory( -diff -ur cctools-port-c1cc758/cctools/include/stuff/macosx_deployment_target.h cctools-port-private-extern/cctools/include/stuff/macosx_deployment_target.h ---- cctools-port-c1cc758/cctools/include/stuff/macosx_deployment_target.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/macosx_deployment_target.h 2017-11-10 18:39:47.814249693 -0800 -@@ -22,6 +22,8 @@ - */ - #include - -+#include -+ - struct macosx_deployment_target { - uint32_t major; /* major version */ - uint32_t minor; /* minor version (if any or zero) */ -diff -ur cctools-port-c1cc758/cctools/include/stuff/ofile.h cctools-port-private-extern/cctools/include/stuff/ofile.h ---- cctools-port-c1cc758/cctools/include/stuff/ofile.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/ofile.h 2017-11-10 18:36:14.268454589 -0800 -@@ -24,9 +24,7 @@ - #ifndef _STUFF_OFILE_H_ - #define _STUFF_OFILE_H_ - --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+#include - - #import - #ifndef AR_EFMT1 -diff -ur cctools-port-c1cc758/cctools/include/stuff/print.h cctools-port-private-extern/cctools/include/stuff/print.h ---- cctools-port-c1cc758/cctools/include/stuff/print.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/print.h 2017-11-10 18:36:24.805244801 -0800 -@@ -20,9 +20,8 @@ - * - * @APPLE_LICENSE_HEADER_END@ - */ --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+ -+#include - - #import - -diff -ur cctools-port-c1cc758/cctools/include/stuff/reloc.h cctools-port-private-extern/cctools/include/stuff/reloc.h ---- cctools-port-c1cc758/cctools/include/stuff/reloc.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/reloc.h 2017-11-10 18:36:31.878661041 -0800 -@@ -20,9 +20,8 @@ - * - * @APPLE_LICENSE_HEADER_END@ - */ --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+ -+#include - - #import - #import "stuff/bool.h" -diff -ur cctools-port-c1cc758/cctools/include/stuff/rnd.h cctools-port-private-extern/cctools/include/stuff/rnd.h ---- cctools-port-c1cc758/cctools/include/stuff/rnd.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/rnd.h 2017-11-10 18:36:39.068745293 -0800 -@@ -27,9 +27,7 @@ - */ - #include - --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+#include - - /* - * rnd() rounds v to a multiple of r. -diff -ur cctools-port-c1cc758/cctools/include/stuff/symbol_list.h cctools-port-private-extern/cctools/include/stuff/symbol_list.h ---- cctools-port-c1cc758/cctools/include/stuff/symbol_list.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/symbol_list.h 2017-11-10 18:37:11.605792928 -0800 -@@ -23,6 +23,8 @@ - #include - #include - -+#include -+ - /* - * Data structures to perform selective stripping of symbol table entries. - */ -diff -ur cctools-port-c1cc758/cctools/include/stuff/unix_standard_mode.h cctools-port-private-extern/cctools/include/stuff/unix_standard_mode.h ---- cctools-port-c1cc758/cctools/include/stuff/unix_standard_mode.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/unix_standard_mode.h 2017-11-10 18:37:42.596155389 -0800 -@@ -22,5 +22,7 @@ - */ - #include "stuff/bool.h" - -+#include -+ - __private_extern__ enum bool get_unix_standard_mode( - void); -diff -ur cctools-port-c1cc758/cctools/include/stuff/vm_flush_cache.h cctools-port-private-extern/cctools/include/stuff/vm_flush_cache.h ---- cctools-port-c1cc758/cctools/include/stuff/vm_flush_cache.h 2017-10-01 13:47:04.000000000 -0700 -+++ cctools-port-private-extern/cctools/include/stuff/vm_flush_cache.h 2017-11-10 18:37:59.973025145 -0800 -@@ -20,9 +20,8 @@ - * - * @APPLE_LICENSE_HEADER_END@ - */ --#if defined(__MWERKS__) && !defined(__private_extern__) --#define __private_extern__ __declspec(private_extern) --#endif -+ -+#include - - #import - __private_extern__ kern_return_t vm_flush_cache( diff --git a/nix/nixcrpkgs/macos/clang_builder.sh b/nix/nixcrpkgs/macos/clang_builder.sh deleted file mode 100644 index 2afa96bb95..0000000000 --- a/nix/nixcrpkgs/macos/clang_builder.sh +++ /dev/null @@ -1,30 +0,0 @@ -source $setup - -tar -xf $llvm_src -mv llvm-* llvm - -tar -xf $lld_src -mv lld-* lld -mv lld llvm/tools/ - -tar -xf $src -mv cfe-* clang -cd clang -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done -cd .. -mv clang llvm/projects/ - -mkdir build -cd build - -cmake ../llvm -GNinja -DDEFAULT_SYSROOT=$out -DCMAKE_INSTALL_PREFIX=$out $cmake_flags - -ninja - -ninja install - -# clang-tblgen is supposed to be an internal tool, but tapi needs it -cp bin/clang-tblgen $out/bin diff --git a/nix/nixcrpkgs/macos/clang_megapatch.patch b/nix/nixcrpkgs/macos/clang_megapatch.patch deleted file mode 100644 index b5941e2c36..0000000000 --- a/nix/nixcrpkgs/macos/clang_megapatch.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -ur cfe-5.0.0.src.orig/lib/Driver/ToolChains/Gnu.cpp cfe-5.0.0.src/lib/Driver/ToolChains/Gnu.cpp ---- cfe-5.0.0.src.orig/lib/Driver/ToolChains/Gnu.cpp 2017-09-13 07:15:52.419093088 -0700 -+++ cfe-5.0.0.src/lib/Driver/ToolChains/Gnu.cpp 2017-09-13 07:21:58.892639000 -0700 -@@ -493,10 +493,6 @@ - CmdArgs.push_back("-export-dynamic"); - - if (!Args.hasArg(options::OPT_shared)) { -- const std::string Loader = -- D.DyldPrefix + ToolChain.getDynamicLinker(Args); -- CmdArgs.push_back("-dynamic-linker"); -- CmdArgs.push_back(Args.MakeArgString(Loader)); - } - } - -diff -ur cfe-5.0.0.src.orig/lib/Driver/ToolChains/Linux.cpp cfe-5.0.0.src/lib/Driver/ToolChains/Linux.cpp ---- cfe-5.0.0.src.orig/lib/Driver/ToolChains/Linux.cpp 2017-09-13 07:15:52.419093088 -0700 -+++ cfe-5.0.0.src/lib/Driver/ToolChains/Linux.cpp 2017-09-13 07:17:58.530311694 -0700 -@@ -195,18 +195,7 @@ - llvm::Triple::ArchType Arch = Triple.getArch(); - std::string SysRoot = computeSysRoot(); - -- // Cross-compiling binutils and GCC installations (vanilla and openSUSE at -- // least) put various tools in a triple-prefixed directory off of the parent -- // of the GCC installation. We use the GCC triple here to ensure that we end -- // up with tools that support the same amount of cross compiling as the -- // detected GCC installation. For example, if we find a GCC installation -- // targeting x86_64, but it is a bi-arch GCC installation, it can also be -- // used to target i386. -- // FIXME: This seems unlikely to be Linux-specific. -- ToolChain::path_list &PPaths = getProgramPaths(); -- PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" + -- GCCInstallation.getTriple().str() + "/bin") -- .str()); -+ // Removed some code here that found programs like ld in "/..//bin" - - Distro Distro(D.getVFS()); - diff --git a/nix/nixcrpkgs/macos/default.nix b/nix/nixcrpkgs/macos/default.nix deleted file mode 100644 index c82f42d5b5..0000000000 --- a/nix/nixcrpkgs/macos/default.nix +++ /dev/null @@ -1,192 +0,0 @@ -# Note: To reduce clutter here, it might be nice to move clang to -# `native`, and also make `native` provide a function for building -# binutils. So clang and binutils recipes could be shared by the -# different platforms we targets. - -{ osx_sdk, native }: -let - nixpkgs = native.nixpkgs; - - arch = "x86_64"; - - # was darwin15, changed to darwin so that lld guesses flavor=Darwin correctly - darwin_name = "darwin15"; - - macos_version_min = "10.11"; - - host = "${arch}-apple-${darwin_name}"; - - os = "macos"; - - compiler = "clang"; - - exe_suffix = ""; - - clang = native.make_derivation rec { - name = "clang"; - - version = "5.0.0"; - - src = nixpkgs.fetchurl { - url = "https://llvm.org/releases/${version}/cfe-${version}.src.tar.xz"; - sha256 = "0w09s8fn3lkn6i04nj0cisgp821r815fk5b5fjn97xrd371277q1"; - }; - - llvm_src = nixpkgs.fetchurl { - url = "https://llvm.org/releases/${version}/llvm-${version}.src.tar.xz"; - sha256 = "1nin64vz21hyng6jr19knxipvggaqlkl2l9jpd5czbc4c2pcnpg3"; - }; - - # Note: We aren't actually using lld for anything yet. - lld_src = nixpkgs.fetchurl { - url = "http://releases.llvm.org/${version}/lld-${version}.src.tar.xz"; - sha256 = "15rqsmfw0jlsri7hszbs8l0j7v1030cy9xvvdb245397llh7k6ir"; - }; - - patches = [ ./clang_megapatch.patch ]; - - builder = ./clang_builder.sh; - - native_inputs = [ nixpkgs.python2 ]; - - cmake_flags = - "-DCMAKE_BUILD_TYPE=Release " + - # "-DCMAKE_BUILD_TYPE=Debug " + - "-DLLVM_TARGETS_TO_BUILD=X86\;ARM " + - "-DLLVM_ENABLE_RTTI=ON " + # ld64 uses dynamic_cast, requiring rtti - "-DLLVM_ENABLE_ASSERTIONS=OFF"; - }; - - # Note: There is an alternative version we could use, but it - # has a copy of LLVM in it: https://github.com/tpoechtrager/apple-libtapi - tapi = native.make_derivation rec { - name = "tapi"; - version = "${version0}.${version1}.${version2}"; - version0 = "2"; - version1 = "0"; - version2 = "0"; - src = nixpkgs.fetchurl { - url = "https://github.com/DavidEGrayson/tapi/archive/f98d0c3.tar.gz"; - sha256 = "0jibz0fsyh47q8y3w6f0qspjh6fhs164rkhjg7x6k7qhlawcdy6g"; - }; - builder = ./tapi_builder.sh; - native_inputs = [ clang ]; - inherit clang; - }; - - cctools_commit = "c1cc758"; - cctools_apple_version = "274.2"; # from README.md - cctools_port_src = nixpkgs.fetchurl { - url = "https://github.com/tpoechtrager/cctools-port/archive/${cctools_commit}.tar.gz"; - sha256= "11bfcndzbdmjp2piabyqs34da617fh5fhirqvb9w87anfan15ffa"; - }; - - ld = native.make_derivation rec { - name = "cctools-ld64"; - apple_version = cctools_apple_version; - src = cctools_port_src; - patches = [ - ./cctools-format.patch - ./cctools-ld64-registers.patch - ]; - builder = ./ld_builder.sh; - native_inputs = [ tapi ]; - inherit host; - }; - - ranlib = native.make_derivation rec { - name = "cctools-ranlib"; - apple_version = cctools_apple_version; - src = ld.src; - builder = ./ranlib_builder.sh; - patches = [ - ./cctools-format.patch - ./cctools-bytesex.patch - ]; - inherit host; - }; - - ar = native.make_derivation rec { - name = "cctools-ar"; - apple_version = cctools_apple_version; - src = cctools_port_src; - builder = ./ar_builder.sh; - patches = [ - ./cctools-format.patch - ./cctools-libstuff-no-error.patch - ]; - inherit host ranlib; - }; - - strip = native.make_derivation rec { - name = "cctools-strip"; - apple_version = cctools_apple_version; - src = cctools_port_src; - builder = ./strip_builder.sh; - patches = [ - ./cctools-format.patch - ]; - inherit host; - }; - - # TODO: add instructions for building the SDK tarball, probably want a copy of - # the script from osxcross. - sdk = native.make_derivation rec { - name = "macos-sdk"; - builder = ./sdk_builder.sh; - src = osx_sdk; - }; - - toolchain = native.make_derivation rec { - name = "macos-toolchain"; - builder = ./toolchain_builder.sh; - src_file = ./wrapper.cpp; - inherit host clang ld ranlib ar strip sdk; - - CXXFLAGS = - "-std=c++11 " + - "-Wall " + - "-I. " + - "-O2 -g " + - "-DWRAPPER_OS_VERSION_MIN=\\\"${macos_version_min}\\\" " + - "-DWRAPPER_HOST=\\\"${host}\\\" " + - "-DWRAPPER_ARCH=\\\"${arch}\\\" " + - "-DWRAPPER_SDK_PATH=\\\"${sdk}\\\" " + - "-DWRAPPER_LINKER_VERSION=\\\"${ld.apple_version}\\\""; - }; - - cmake_toolchain = import ../cmake_toolchain { - cmake_system_name = "Darwin"; - inherit nixpkgs host; - }; - - crossenv = { - is_cross = true; - - # Build tools available on the PATH for every derivation. - default_native_inputs = native.default_native_inputs - ++ [ clang toolchain native.wrappers ]; - - # Target info environment variables. - inherit host arch os compiler exe_suffix macos_version_min; - - # CMake toolchain file. - inherit cmake_toolchain; - - # A wide variety of programs and build tools. - inherit nixpkgs; - - # Some native build tools made by nixcrpkgs. - inherit native; - - # License information that should be shipped with any software - # compiled by this environment. - global_license_set = { }; - - # Make it easy to build or refer to the build tools. - inherit clang tapi ld ranlib ar sdk toolchain strip; - - make_derivation = import ../make_derivation.nix crossenv; - }; -in - crossenv diff --git a/nix/nixcrpkgs/macos/gen_sdk_package.sh b/nix/nixcrpkgs/macos/gen_sdk_package.sh deleted file mode 100755 index 843171ba69..0000000000 --- a/nix/nixcrpkgs/macos/gen_sdk_package.sh +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash -# -# Package the OS X SDKs into a tar file to be used by `build.sh`. -# - -# This file comes from the osxcross project and is licensed under the GNU GPLv2. -# For more information, see the `COPYING` file from: -# https://github.com/tpoechtrager/osxcross/tree/1a1733a773fe26e7b6c93b16fbf9341f22fac831 - -export LC_ALL=C - -function set_xcode_dir() -{ - local tmp=$(ls $1 2>/dev/null | grep "^Xcode.*.app" | grep -v "beta" | head -n1) - - if [ -z "$tmp" ]; then - tmp=$(ls $1 2>/dev/null | grep "^Xcode.*.app" | head -n1) - fi - - if [ -n "$tmp" ]; then - XCODEDIR="$1/$tmp" - fi -} - -if [ $(uname -s) != "Darwin" ]; then - if [ -z "$XCODEDIR" ]; then - echo "This script must be run on OS X" 1>&2 - echo "... Or with XCODEDIR=... on Linux" 1>&2 - exit 1 - else - case $XCODEDIR in - /*) ;; - *) XCODEDIR="$PWD/$XCODEDIR" ;; - esac - set_xcode_dir $XCODEDIR - fi -else - set_xcode_dir $(echo /Volumes/Xcode* | tr ' ' '\n' | grep -v "beta" | head -n1) - - if [ -z "$XCODEDIR" ]; then - set_xcode_dir /Applications - - if [ -z "$XCODEDIR" ]; then - set_xcode_dir $(echo /Volumes/Xcode* | tr ' ' '\n' | head -n1) - - if [ -z "$XCODEDIR" ]; then - echo "please mount Xcode.dmg" 1>&2 - exit 1 - fi - fi - fi -fi - -if [ ! -d $XCODEDIR ]; then - echo "cannot find Xcode (XCODEDIR=$XCODEDIR)" 1>&2 - exit 1 -fi - -echo -e "found Xcode: $XCODEDIR" - -WDIR=$(pwd) - -which gnutar &>/dev/null - -if [ $? -eq 0 ]; then - TAR=gnutar -else - TAR=tar -fi - -which xz &>/dev/null - -if [ $? -eq 0 ]; then - COMPRESSOR=xz - PKGEXT="tar.xz" -else - COMPRESSOR=bzip2 - PKGEXT="tar.bz2" -fi - -set -e - -pushd $XCODEDIR &>/dev/null - -if [ -d "Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" ]; then - pushd "Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" &>/dev/null -else - if [ -d "../Packages" ]; then - pushd "../Packages" &>/dev/null - elif [ -d "Packages" ]; then - pushd "Packages" &>/dev/null - else - if [ $? -ne 0 ]; then - echo "Xcode (or this script) is out of date" 1>&2 - echo "trying some magic to find the SDKs anyway ..." 1>&2 - - SDKDIR=$(find . -name SDKs -type d | grep MacOSX | head -n1) - - if [ -z "$SDKDIR" ]; then - echo "cannot find SDKs!" 1>&2 - exit 1 - fi - - pushd $SDKDIR &>/dev/null - fi - fi -fi - -SDKS=$(ls | grep "^MacOSX10.*" | grep -v "Patch") - -if [ -z "$SDKS" ]; then - echo "No SDK found" 1>&2 - exit 1 -fi - -# Xcode 5 -LIBCXXDIR1="Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1" - -# Xcode 6 -LIBCXXDIR2="Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1" - -# Manual directory -MANDIR="Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man" - -for SDK in $SDKS; do - echo -n "packaging $(echo "$SDK" | sed -E "s/(.sdk|.pkg)//g") SDK " - echo "(this may take several minutes) ..." - - if [[ $SDK == *.pkg ]]; then - cp $SDK $WDIR - continue - fi - - TMP=$(mktemp -d /tmp/XXXXXXXXXXX) - cp -r $SDK $TMP &>/dev/null || true - - pushd $XCODEDIR &>/dev/null - - # libc++ headers for C++11/C++14 - if [ -d $LIBCXXDIR1 ]; then - cp -rf $LIBCXXDIR1 "$TMP/$SDK/usr/include/c++" - elif [ -d $LIBCXXDIR2 ]; then - cp -rf $LIBCXXDIR2 "$TMP/$SDK/usr/include/c++" - fi - - if [ -d $MANDIR ]; then - mkdir -p $TMP/$SDK/usr/share/man - cp -rf $MANDIR/* $TMP/$SDK/usr/share/man - fi - - popd &>/dev/null - - pushd $TMP &>/dev/null - $TAR -cf - * | $COMPRESSOR -9 -c - > "$WDIR/$SDK.$PKGEXT" - popd &>/dev/null - - rm -rf $TMP -done - -popd &>/dev/null -popd &>/dev/null - -echo "" -ls -lh | grep MacOSX diff --git a/nix/nixcrpkgs/macos/ld_builder.sh b/nix/nixcrpkgs/macos/ld_builder.sh deleted file mode 100644 index 29453d31c8..0000000000 --- a/nix/nixcrpkgs/macos/ld_builder.sh +++ /dev/null @@ -1,45 +0,0 @@ -source $setup - -tar -xf $src -mv cctools-port-* cctools-port - -cd cctools-port - -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done - -# Similar to but not the same as the other _structs.h. -rm cctools/include/foreign/mach/i386/_structs.h - -cd .. - -mv cctools-port/cctools/ld64 ld64 -mv cctools-port/cctools/include include -rm -r cctools-port -rm -r ld64/src/other - -mkdir build -cd build - -CFLAGS="-Wno-deprecated -Wno-deprecated-declarations -Wno-unused-result -Werror -Wfatal-errors -O2 -g -I../ld64/src -I../ld64/src/ld -I../ld64/src/ld/parsers -I../ld64/src/abstraction -I../ld64/src/3rd -I../ld64/src/3rd/include -I../ld64/src/3rd/BlocksRuntime -I../include -I../include/foreign -DTAPI_SUPPORT -DPROGRAM_PREFIX=\\\"$host-\\\" -D__LITTLE_ENDIAN__ -D__private_extern__= $(pkg-config --cflags libtapi)" - -CXXFLAGS="-std=gnu++11 $CFLAGS" - -LDFLAGS="$(pkg-config --libs libtapi) -ldl -lpthread" - -for f in ../ld64/src/ld/*.c ../ld64/src/3rd/*.c; do - echo "compiling $f" - eval "gcc -c $CFLAGS $f -o $(basename $f).o" -done - -for f in $(find ../ld64/src -name \*.cpp); do - echo "compiling $f" - eval "g++ -c $CXXFLAGS $f -o $(basename $f).o" -done - -g++ *.o $LDFLAGS -o $host-ld - -mkdir -p $out/bin -cp $host-ld $out/bin diff --git a/nix/nixcrpkgs/macos/ranlib_builder.sh b/nix/nixcrpkgs/macos/ranlib_builder.sh deleted file mode 100644 index 15c0bd206d..0000000000 --- a/nix/nixcrpkgs/macos/ranlib_builder.sh +++ /dev/null @@ -1,45 +0,0 @@ -source $setup - -tar -xf $src -mv cctools-port-* cctools-port - -cd cctools-port - -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done - -# Similar to but not the same as the other _structs.h. -rm cctools/include/foreign/mach/i386/_structs.h - -# Causes a troublesome undefined reference. -rm cctools/libstuff/vm_flush_cache.c - -cd .. - -mv cctools-port/cctools/misc . -mv cctools-port/cctools/include . -mv cctools-port/cctools/libstuff . -rm -r cctools-port - -mkdir build -cd build - -CFLAGS="-Wno-deprecated -Wno-deprecated-declarations -Wno-unused-result -Wno-format-overflow -Werror -Wfatal-errors -O2 -g -I../include -I../include/foreign -DPROGRAM_PREFIX=\\\"$host-\\\" -D__LITTLE_ENDIAN__ -D__private_extern__= -D__DARWIN_UNIX03 -DPACKAGE_NAME=\\\"cctools\\\" -DPACKAGE_VERSION=\\\"$apple_version\\\" -DEMULATED_HOST_CPU_TYPE=16777223 -DEMULATED_HOST_CPU_SUBTYPE=3" - -CXXFLAGS="-std=gnu++11 $CFLAGS" - -LDFLAGS="-ldl" - -for f in ../libstuff/*.c ; do - echo "compiling $f" - eval "gcc -c $CFLAGS $f -o $(basename $f).o" -done - -eval "gcc $CFLAGS ../misc/libtool.c *.o $LDFLAGS -o $host-libtool" -eval "gcc $CFLAGS -DRANLIB ../misc/libtool.c *.o $LDFLAGS -o $host-ranlib" - -mkdir -p $out/bin -cp $host-libtool $host-ranlib $out/bin/ - diff --git a/nix/nixcrpkgs/macos/sdk_builder.sh b/nix/nixcrpkgs/macos/sdk_builder.sh deleted file mode 100644 index 8a0f872e01..0000000000 --- a/nix/nixcrpkgs/macos/sdk_builder.sh +++ /dev/null @@ -1,4 +0,0 @@ -source $setup - -tar -xf $src -mv MacOSX*.sdk $out diff --git a/nix/nixcrpkgs/macos/strip_builder.sh b/nix/nixcrpkgs/macos/strip_builder.sh deleted file mode 100644 index e69a129493..0000000000 --- a/nix/nixcrpkgs/macos/strip_builder.sh +++ /dev/null @@ -1,43 +0,0 @@ -source $setup - -tar -xf $src -mv cctools-port-* cctools-port - -cd cctools-port - -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done - -# Similar to but not the same as the other _structs.h. -rm cctools/include/foreign/mach/i386/_structs.h - -# Causes a troublesome undefined reference. -rm cctools/libstuff/vm_flush_cache.c - -cd .. - -mv cctools-port/cctools/misc . -mv cctools-port/cctools/include . -mv cctools-port/cctools/libstuff . -rm -r cctools-port - -mkdir build -cd build - -CFLAGS="-Wno-deprecated -Wno-deprecated-declarations -Wno-unused-result -Werror -Wfatal-errors -O2 -g -I../include -I../include/foreign -DPROGRAM_PREFIX=\\\"$host-\\\" -D__LITTLE_ENDIAN__ -D__private_extern__= -D__DARWIN_UNIX03 -DPACKAGE_NAME=\\\"cctools\\\" -DPACKAGE_VERSION=\\\"$apple_version\\\" -DEMULATED_HOST_CPU_TYPE=16777223 -DEMULATED_HOST_CPU_SUBTYPE=3" - -CXXFLAGS="-std=gnu++11 $CFLAGS" - -LDFLAGS="-ldl -lpthread" - -for f in ../misc/strip.c ../libstuff/*.c; do - echo "compiling $f" - eval "gcc -c $CFLAGS $f -o $(basename $f).o" -done - -gcc *.o $LDFLAGS -o $host-strip - -mkdir -p $out/bin -cp $host-strip $out/bin/ diff --git a/nix/nixcrpkgs/macos/tapi_builder.sh b/nix/nixcrpkgs/macos/tapi_builder.sh deleted file mode 100644 index d8c15a6a10..0000000000 --- a/nix/nixcrpkgs/macos/tapi_builder.sh +++ /dev/null @@ -1,80 +0,0 @@ -source $setup - -tar -xf $src -mv tapi-* tapi - -mkdir build -cd build - -mkdir -p include/tapi/{Core,Driver} -cat > include/tapi/Core/ArchitectureConfig.h < include/tapi/Version.inc < $out/lib/pkgconfig/libtapi.pc < -#include -#include -#include -#include -#include - -int do_exec(const std::string & compiler_name, - const std::vector & args) -{ - char ** exec_args = new char *[args.size() + 1]; - size_t i = 0; - for (const std::string & arg : args) - { - exec_args[i++] = (char *)arg.c_str(); - } - exec_args[i] = nullptr; - - execvp(compiler_name.c_str(), exec_args); - - int result = errno; - std::cerr << "execvp failed: " << compiler_name << ": " - << strerror(result) << std::endl; - return 1; -} - -int compiler_main(int argc, char ** argv, - const std::string & compiler_name) -{ - std::vector args; - - args.push_back(compiler_name); - - args.push_back("-target"); - args.push_back(WRAPPER_HOST); - - args.push_back("-mmacosx-version-min=" WRAPPER_OS_VERSION_MIN); - - // The ld64 linker will just assume sdk_version is the same as - // macosx-version-min if we don't supply it. That probably will not - // do any harm. - // args.push_back("-Wl,-sdk_version," WRAPPER_SDK_VERSION); - - // Suppress warnings about the -Wl arguments not being used when we're just - // compiling and not linking. - args.push_back("-Wno-unused-command-line-argument"); - - args.push_back("--sysroot"); - args.push_back(WRAPPER_SDK_PATH); - - // Causes clang to pass -demangle, -lto_library, -no_deduplicate, and other - // options that could be useful. Version 274.2 is the version number used here: - // https://github.com/tpoechtrager/osxcross/blob/474f359/build.sh#L140 - if (WRAPPER_LINKER_VERSION[0]) - { - args.push_back("-mlinker-version=" WRAPPER_LINKER_VERSION); - } - - if (compiler_name == "clang++") - { - args.push_back("-stdlib=libc++"); - args.push_back("-cxx-isystem"); - args.push_back(WRAPPER_SDK_PATH "/usr/include/c++/v1"); - } - - for (int i = 1; i < argc; ++i) - { - args.push_back(argv[i]); - } - - return do_exec(compiler_name, args); -} - -int c_compiler_main(int argc, char ** argv) -{ - return compiler_main(argc, argv, "clang"); -} - -int cxx_compiler_main(int argc, char ** argv) -{ - return compiler_main(argc, argv, "clang++"); -} - -int wrapper_main(int argc, char ** argv) -{ - std::cout << - "host: " WRAPPER_HOST "\n" - "path: " WRAPPER_PATH "\n" - "sdk_path: " WRAPPER_SDK_PATH "\n"; - return 0; -} - -struct { - const char * name; - int (*main_func)(int argc, char ** argv); -} prgms[] = { - { WRAPPER_HOST "-gcc", c_compiler_main }, - { WRAPPER_HOST "-cc", c_compiler_main }, - { WRAPPER_HOST "-clang", c_compiler_main }, - { WRAPPER_HOST "-g++", cxx_compiler_main }, - { WRAPPER_HOST "-c++", cxx_compiler_main }, - { WRAPPER_HOST "-clang++", cxx_compiler_main }, - { WRAPPER_HOST "-wrapper", wrapper_main }, - { nullptr, nullptr }, -}; - -const char * get_program_name(const char * path) -{ - const char * p = strrchr(path, '/'); - if (p) { path = p + 1; } - return path; -} - -int main(int argc, char ** argv) -{ - // We only want this wrapper and the compiler it invokes to access a certain - // set of tools that are determined at build time. Ignore whatever is on the - // user's path and use the path specified by our Nix expression instead. - int result = setenv("PATH", WRAPPER_PATH, 1); - if (result) - { - std::cerr << "wrapper failed to set PATH" << std::endl; - return 1; - } - - std::string program_name = get_program_name(argv[0]); - - for (auto * p = prgms; p->name; p++) - { - if (program_name == p->name) - { - return p->main_func(argc, argv); - } - } - - std::cerr << "compiler wrapper invoked with unknown program name: " - << argv[0] << std::endl; - return 1; -} diff --git a/nix/nixcrpkgs/make_derivation.nix b/nix/nixcrpkgs/make_derivation.nix deleted file mode 100644 index af74ee91fd..0000000000 --- a/nix/nixcrpkgs/make_derivation.nix +++ /dev/null @@ -1,91 +0,0 @@ -env: attrs: - -let - nixpkgs = env.nixpkgs; - - native_inputs = - (attrs.native_inputs or []) - ++ env.default_native_inputs; - - cross_inputs = (attrs.cross_inputs or []); - - path_join = builtins.concatStringsSep ":"; - - path_map = dir: inputs: (map (i: "${i}" + dir) inputs); - - # We can't just set PATH in our derivation because nix-shell will make the - # derivation's PATH override the system PATH, meaning we can't use utilities - # like "git" or "which" form the host system. So we set _PATH instead, and we - # use a setup script ($setup) that copies _PATH to PATH. And we provide - # $stdenv/setup so that nix-shell can find our setup script. - # - # nixcrpkgs does not expose its users to this mess. The user can specify a - # PATH if they want, and it will be automatically moved to _PATH in the - # derivation. - filtered_attrs = nixpkgs.lib.filterAttrs (n: v: n != "PATH") attrs; - - path_attrs = { - _PATH = path_join ( - (if attrs ? PATH then [attrs.PATH] else []) ++ - (path_map "/bin" native_inputs) - ); - }; - - default_attrs = { - system = builtins.currentSystem; - - SHELL = "${nixpkgs.bashInteractive}/bin/bash"; - - setup = ./pretend_stdenv/setup; - - # This allows nix-shell to find our setup script. - stdenv = ./pretend_stdenv; - - PKG_CONFIG_PATH = path_join ( - (if attrs ? PKG_CONFIG_PATH then [attrs.PKG_CONFIG_PATH] else []) ++ - (path_map "/lib/pkgconfig" native_inputs) - ); - }; - - cross_attrs = if !env.is_cross then {} else { - NIXCRPKGS = true; - - inherit (env) host arch os exe_suffix; - inherit (env) cmake_toolchain; - - PKG_CONFIG_CROSS_PATH = path_join ( - (if attrs ? PKG_CONFIG_CROSS_PATH then [attrs.PKG_CONFIG_CROSS_PATH] else []) ++ - (path_map "/lib/pkgconfig" cross_inputs) - ); - - CMAKE_CROSS_PREFIX_PATH = path_join ( - (if attrs ? CMAKE_CROSS_PREFIX_PATH then [attrs.CMAKE_CROSS_PREFIX_PATH] else []) ++ - cross_inputs - ); - }; - - name_attrs = { - name = (attrs.name or "package") - + (if env.is_cross then "-${env.host}" else ""); - }; - - builder_attrs = - if builtins.isAttrs attrs.builder then - if attrs.builder ? ruby then - { - builder = "${nixpkgs.ruby}/bin/ruby"; - args = [attrs.builder.ruby]; - } - else - attrs.builder - else - rec { - builder = "${nixpkgs.bashInteractive}/bin/bash"; - args = ["-ue" attrs.builder]; - }; - - drv_attrs = default_attrs // cross_attrs - // filtered_attrs // name_attrs // builder_attrs // path_attrs; - -in - derivation drv_attrs diff --git a/nix/nixcrpkgs/mingw-w64/binutils/builder.sh b/nix/nixcrpkgs/mingw-w64/binutils/builder.sh deleted file mode 100644 index 8795ea0ce1..0000000000 --- a/nix/nixcrpkgs/mingw-w64/binutils/builder.sh +++ /dev/null @@ -1,26 +0,0 @@ -source $stdenv/setup - -unset CC CXX CFLAGS LDFLAGS LD AR AS RANLIB SIZE STRINGS NM STRIP OBJCOPY - -tar -xf $src - -cd binutils-$version -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done - -# Clear the default library search path (noSysDirs) -echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt - -cd .. - -mkdir build -cd build - -../binutils-$version/configure --prefix=$out $configure_flags - -make - -make install - diff --git a/nix/nixcrpkgs/mingw-w64/binutils/default.nix b/nix/nixcrpkgs/mingw-w64/binutils/default.nix deleted file mode 100644 index 1a52fd2260..0000000000 --- a/nix/nixcrpkgs/mingw-w64/binutils/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ native, host }: - -native.make_derivation rec { - name = "binutils-${version}-${host}"; - - version = "2.27"; - - src = native.nixpkgs.fetchurl { - url = "mirror://gnu/binutils/binutils-${version}.tar.bz2"; - sha256 = "125clslv17xh1sab74343fg6v31msavpmaa1c1394zsqa773g5rn"; - }; - - patches = [ - ./deterministic.patch - ]; - - build_inputs = [ native.nixpkgs.bison native.nixpkgs.zlib ]; - - configure_flags = - "--target=${host} " + - "--enable-shared " + - "--enable-deterministic-archives " + - "--disable-werror "; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/mingw-w64/binutils/deterministic.patch b/nix/nixcrpkgs/mingw-w64/binutils/deterministic.patch deleted file mode 100644 index 0a264b35c7..0000000000 --- a/nix/nixcrpkgs/mingw-w64/binutils/deterministic.patch +++ /dev/null @@ -1,12 +0,0 @@ -Make binutils output deterministic by default. ---- orig/ld/ldlang.c -+++ new/ld/ldlang.c -@@ -3095,6 +3095,8 @@ - ldfile_output_machine)) - einfo (_("%P%F:%s: can not set architecture: %E\n"), name); - -+ link_info.output_bfd->flags |= BFD_DETERMINISTIC_OUTPUT; -+ - link_info.hash = bfd_link_hash_table_create (link_info.output_bfd); - if (link_info.hash == NULL) - einfo (_("%P%F: can not create hash table: %E\n")); diff --git a/nix/nixcrpkgs/mingw-w64/builder.sh b/nix/nixcrpkgs/mingw-w64/builder.sh deleted file mode 100644 index 65c9e68e38..0000000000 --- a/nix/nixcrpkgs/mingw-w64/builder.sh +++ /dev/null @@ -1,35 +0,0 @@ -source $setup - -cp -r $src mingw-w64 -chmod -R u+w mingw-w64 - -cd mingw-w64 -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done -cd .. - -if [ -n "$just_headers" ]; then - mkdir build_headers - cd build_headers - ../mingw-w64/mingw-w64-headers/configure --prefix=$out $configure_flags - make - make install - cd .. -else - mkdir build_crt_and_headers - cd build_crt_and_headers - ../mingw-w64/configure --prefix=$out $configure_flags - make - make install - cd .. - - mkdir build_winpthreads - cd build_winpthreads - LDFLAGS="-L${out}/lib" ../mingw-w64/mingw-w64-libraries/winpthreads/configure \ - --host=$host --prefix=$out --disable-shared --enable-static - make - make install - cd .. -fi diff --git a/nix/nixcrpkgs/mingw-w64/default.nix b/nix/nixcrpkgs/mingw-w64/default.nix deleted file mode 100644 index 691c271549..0000000000 --- a/nix/nixcrpkgs/mingw-w64/default.nix +++ /dev/null @@ -1,106 +0,0 @@ -{ native, arch }: - -let - nixpkgs = native.nixpkgs; - - host = "${arch}-w64-mingw32"; - - binutils = import ./binutils { inherit native host; }; - - mingw-w64_info = rec { - name = "mingw-w64-${version}"; - version = "2017-08-03"; - src = nixpkgs.fetchgit { - url = "git://git.code.sf.net/p/mingw-w64/mingw-w64"; - rev = "6de0055f99ed447ec63c1a650a3830f266a808bd"; - sha256 = "1830rcd0vsbvpr5m1lrabcqh12qrw1flq333b8xrs5b3n542xy2i"; - }; - patches = [ - ./usb.patch - ./guid-selectany.patch - ]; - configure_flags = "--enable-secure-api --enable-idl"; - }; - - mingw-w64_headers = native.make_derivation { - name = "${mingw-w64_info.name}-headers"; - inherit host; - inherit (mingw-w64_info) src patches configure_flags; - builder = ./builder.sh; - just_headers = true; - }; - - gcc_stage_1 = import ./gcc { - stage = 1; - libc = mingw-w64_headers; - inherit native arch binutils; - }; - - mingw-w64_full = native.make_derivation { - name = "${mingw-w64_info.name}-${host}"; - inherit host; - inherit (mingw-w64_info) version src patches; - configure_flags = - "--host=${host} " + - "--disable-shared --enable-static " + - mingw-w64_info.configure_flags; - native_inputs = [ binutils gcc_stage_1 ]; - builder = ./builder.sh; - just_headers = false; - }; - - gcc = import ./gcc { - libc = mingw-w64_full; - inherit native arch binutils; - }; - - license = native.make_derivation { - name = "${mingw-w64_info.name}-license"; - inherit (mingw-w64_info) version src; - gcc_src = gcc.src; - builder = ./license_builder.sh; - }; - - global_license_set = { _global = license; }; - - cmake_toolchain = import ../cmake_toolchain { - cmake_system_name = "Windows"; - inherit nixpkgs host; - }; - - os = "windows"; - - compiler = "gcc"; - - exe_suffix = ".exe"; - - crossenv = { - is_cross = true; - - default_native_inputs = native.default_native_inputs - ++ [ gcc binutils native.pkgconf native.wrappers ]; - - # Target info variables. - inherit host arch os compiler exe_suffix; - - # CMake toolchain file. - inherit cmake_toolchain; - - # A wide variety of programs and build tools. - inherit nixpkgs; - - # Some native build tools made by nixcrpkgs. - inherit native; - - # License information that should be shipped with any software compiled by - # this environment. - inherit global_license_set; - - # Make it easy to build or refer to the build tools. - inherit gcc binutils mingw-w64_full mingw-w64_info mingw-w64_headers gcc_stage_1; - mingw-w64 = mingw-w64_full; - - make_derivation = import ../make_derivation.nix crossenv; - }; -in - crossenv diff --git a/nix/nixcrpkgs/mingw-w64/gcc/builder.sh b/nix/nixcrpkgs/mingw-w64/gcc/builder.sh deleted file mode 100644 index ae8462f8d8..0000000000 --- a/nix/nixcrpkgs/mingw-w64/gcc/builder.sh +++ /dev/null @@ -1,63 +0,0 @@ -source $setup - -tar -xf $src - -cd gcc-$version -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done - -# Prevents a name collision with mingw-w64 headers. -# See: https://gcc.gnu.org/ml/gcc-help/2017-05/msg00121.html -cd libstdc++-v3 -sed -i 's/\b__in\b/___in/g' \ - include/ext/random.tcc \ - include/ext/vstring.tcc \ - include/std/utility \ - include/std/tuple \ - include/std/istream \ - include/tr2/bool_set.tcc \ - include/tr2/bool_set \ - include/bits/basic_string.h \ - include/bits/basic_string.tcc \ - include/bits/locale_facets.h \ - include/bits/istream.tcc \ - include/tr1/utility \ - include/tr1/tuple -sed -i 's/\b__out\b/___out/g' \ - include/ext/random.tcc \ - include/ext/algorithm \ - include/ext/pb_ds/detail/debug_map_base.hpp \ - include/std/ostream \ - include/std/thread \ - include/tr2/bool_set \ - include/bits/ostream.tcc \ - include/bits/regex.tcc \ - include/bits/stl_algo.h \ - include/bits/locale_conv.h \ - include/bits/regex.h \ - include/bits/ostream_insert.h \ - include/tr1/regex \ - include/parallel/algo.h \ - include/parallel/set_operations.h \ - include/parallel/multiway_merge.h \ - include/parallel/unique_copy.h \ - include/experimental/algorithm \ - config/locale/dragonfly/c_locale.h \ - config/locale/generic/c_locale.h \ - config/locale/gnu/c_locale.h - -cd ../.. - -mkdir build -cd build - -../gcc-$version/configure --prefix=$out $configure_flags - -make $make_flags - -make $install_targets - -# Remove "install-tools" so we don't have a reference to bash. -rm -r "$out/libexec/gcc/$target/$version/install-tools/" diff --git a/nix/nixcrpkgs/mingw-w64/gcc/cppdefault.patch b/nix/nixcrpkgs/mingw-w64/gcc/cppdefault.patch deleted file mode 100644 index adc979e68b..0000000000 --- a/nix/nixcrpkgs/mingw-w64/gcc/cppdefault.patch +++ /dev/null @@ -1,35 +0,0 @@ -cppdefault.c If CROSS_DIRECTORY_STRUCTURE is defined, don't use the native -system header dir; use CROSS_INCLUDE_DIR instead if it is defined. - -This just makes GCC's behavior match the documentation for the -"--with-sysroot" configure option, which corresponds to -TARGET_SYSTEM_ROOT. The documentation says that if you specify -directories with --with-sysroot and --with-native-system-header-dir, -then the compilter will concatenate the the two together (with the -sysroot coming first) and search that directory instead of the default -/usr/include. - -The concatenation is done with this line in configure.ac: - - CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' - -Then Makefile.in sets the preprocessor macro CROSS_INCLUDE_DIR equal to -CROSS_SYSTEM_HEADER_DIR. - -This patch reverts one of the changes from Daniel Jacobowitz on 2013-02-13. -https://github.com/gcc-mirror/gcc/commit/17acc97af91fbd116659301b0b7d4965ecc1631d - ---- gcc-5.4.0/gcc/cppdefault.c -+++ gcc-5.4.0/gcc/cppdefault.c -@@ -28,9 +28,9 @@ - #define NATIVE_SYSTEM_HEADER_COMPONENT 0 - #endif - --#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) -+#if defined (CROSS_DIRECTORY_STRUCTURE) - # undef LOCAL_INCLUDE_DIR - # undef NATIVE_SYSTEM_HEADER_DIR - #else - # undef CROSS_INCLUDE_DIR - #endif - diff --git a/nix/nixcrpkgs/mingw-w64/gcc/default.nix b/nix/nixcrpkgs/mingw-w64/gcc/default.nix deleted file mode 100644 index 8a5a46b7b7..0000000000 --- a/nix/nixcrpkgs/mingw-w64/gcc/default.nix +++ /dev/null @@ -1,103 +0,0 @@ -{ native, arch, stage ? 2, binutils, libc }: - -let - nixpkgs = native.nixpkgs; - isl = nixpkgs.isl_0_14; - inherit (nixpkgs) stdenv lib fetchurl; - inherit (nixpkgs) gettext gmp libmpc libelf mpfr texinfo which zlib; - - stageName = if stage == 1 then "-stage1" - else assert stage == 2; ""; -in - -native.make_derivation rec { - name = "gcc-${version}-${target}${stageName}"; - - target = "${arch}-w64-mingw32"; - - version = "6.3.0"; - - src = fetchurl { - url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2"; - sha256 = "17xjz30jb65hcf714vn9gcxvrrji8j20xm7n33qg1ywhyzryfsph"; - }; - - builder = ./builder.sh; - - patches = [ - # TODO: combine three of these patches into one called search-dirs.patch - ./mingw-search-paths.patch - ./use-source-date-epoch.patch - ./libstdc++-target.patch - ./no-sys-dirs.patch - ./cppdefault.patch - - # Fix a compiler error in GCC's ubsan.c: ISO C++ forbids comparison - # between pointer and integer. - ./ubsan.patch - ]; - - # TODO: can probably remove libelf here, and might as well remove - # the libraries that are given to GCC as configure flags - # TODO: just let GCC use its own gettext (intl) - native_inputs = [ - binutils gettext libelf texinfo which zlib - ]; - - configure_flags = - "--target=${arch}-w64-mingw32 " + - "--with-sysroot=${libc} " + - "--with-native-system-header-dir=/include " + - "--with-gnu-as " + - "--with-gnu-ld " + - "--with-as=${binutils}/bin/${arch}-w64-mingw32-as " + - "--with-ld=${binutils}/bin/${arch}-w64-mingw32-ld " + - "--with-isl=${isl} " + - "--with-gmp-include=${gmp.dev}/include " + - "--with-gmp-lib=${gmp.out}/lib " + - "--with-mpfr-include=${mpfr.dev}/include " + - "--with-mpfr-lib=${mpfr.out}/lib " + - "--with-mpc=${libmpc} " + - "--with-zlib-include=${zlib.dev}/include " + - "--with-zlib-lib=${zlib.out}/lib " + - "--enable-lto " + - "--enable-plugin " + - "--enable-static " + - "--enable-sjlj-exceptions " + - "--enable-__cxa_atexit " + - "--enable-long-long " + - "--with-dwarf2 " + - "--enable-fully-dynamic-string " + - (if stage == 1 then - "--enable-languages=c " + - "--enable-threads=win32 " - else - "--enable-languages=c,c++ " + - "--enable-threads=posix " - ) + - "--without-included-gettext " + - "--disable-libstdcxx-pch " + - "--disable-nls " + - "--disable-shared " + - "--disable-multilib " + - "--disable-libssp " + - "--disable-win32-registry " + - "--disable-bootstrap"; # TODO: not needed, --disable-bootstrap - # only applies to native builds - - make_flags = - if stage == 1 then - ["all-gcc" "all-target-libgcc"] - else - []; - - install_targets = - if stage == 1 then - ["install-gcc install-target-libgcc"] - else - ["install-strip"]; - - hardeningDisable = [ "format" ]; -} - -# TODO: why is GCC providing a fixed limits.h? diff --git a/nix/nixcrpkgs/mingw-w64/gcc/libstdc++-target.patch b/nix/nixcrpkgs/mingw-w64/gcc/libstdc++-target.patch deleted file mode 100644 index fb622b3958..0000000000 --- a/nix/nixcrpkgs/mingw-w64/gcc/libstdc++-target.patch +++ /dev/null @@ -1,32 +0,0 @@ -Patch to make the target libraries 'configure' scripts find the proper CPP. -I noticed that building the mingw32 cross compiler. -Looking at the build script for mingw in archlinux, I think that only nixos -needs this patch. I don't know why. -diff --git a/Makefile.in b/Makefile.in -index 93f66b6..d691917 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -266,6 +266,7 @@ BASE_TARGET_EXPORTS = \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \ -+ CPP="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ - CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ -@@ -291,11 +292,13 @@ BASE_TARGET_EXPORTS = \ - RAW_CXX_TARGET_EXPORTS = \ - $(BASE_TARGET_EXPORTS) \ - CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ -- CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; -+ CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \ -+ CXXCPP="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX; - - NORMAL_TARGET_EXPORTS = \ - $(BASE_TARGET_EXPORTS) \ -- CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; -+ CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \ -+ CXXCPP="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX; - - # Where to find GMP - HOST_GMPLIBS = @gmplibs@ diff --git a/nix/nixcrpkgs/mingw-w64/gcc/mingw-search-paths.patch b/nix/nixcrpkgs/mingw-w64/gcc/mingw-search-paths.patch deleted file mode 100644 index c79730e10d..0000000000 --- a/nix/nixcrpkgs/mingw-w64/gcc/mingw-search-paths.patch +++ /dev/null @@ -1,14 +0,0 @@ -Make it so GCC does not force us to have a "mingw" symlink. - ---- gcc-6.3.0-orig/gcc/config/i386/mingw32.h -+++ gcc-6.3.0/gcc/config/i386/mingw32.h -@@ -163,3 +163,3 @@ - #ifndef STANDARD_STARTFILE_PREFIX_1 --#define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/" -+#define STANDARD_STARTFILE_PREFIX_1 "/lib/" - #endif -@@ -172,3 +172,3 @@ - #undef NATIVE_SYSTEM_HEADER_DIR --#define NATIVE_SYSTEM_HEADER_DIR "/mingw/include" -+#define NATIVE_SYSTEM_HEADER_DIR "/include" - diff --git a/nix/nixcrpkgs/mingw-w64/gcc/no-sys-dirs.patch b/nix/nixcrpkgs/mingw-w64/gcc/no-sys-dirs.patch deleted file mode 100644 index 36df51904a..0000000000 --- a/nix/nixcrpkgs/mingw-w64/gcc/no-sys-dirs.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -ru -x '*~' gcc-4.8.3-orig/gcc/cppdefault.c gcc-4.8.3/gcc/cppdefault.c ---- gcc-4.8.3-orig/gcc/cppdefault.c 2013-01-10 21:38:27.000000000 +0100 -+++ gcc-4.8.3/gcc/cppdefault.c 2014-08-18 16:20:32.893944536 +0200 -@@ -35,6 +35,8 @@ - # undef CROSS_INCLUDE_DIR - #endif - -+#undef LOCAL_INCLUDE_DIR -+ - const struct default_include cpp_include_defaults[] - #ifdef INCLUDE_DEFAULTS - = INCLUDE_DEFAULTS; -diff -ru -x '*~' gcc-4.8.3-orig/gcc/gcc.c gcc-4.8.3/gcc/gcc.c ---- gcc-4.8.3-orig/gcc/gcc.c 2014-03-23 12:30:57.000000000 +0100 -+++ gcc-4.8.3/gcc/gcc.c 2014-08-18 13:19:32.689201690 +0200 -@@ -1162,10 +1162,10 @@ - /* Default prefixes to attach to command names. */ - - #ifndef STANDARD_STARTFILE_PREFIX_1 --#define STANDARD_STARTFILE_PREFIX_1 "/lib/" -+#define STANDARD_STARTFILE_PREFIX_1 "" - #endif - #ifndef STANDARD_STARTFILE_PREFIX_2 --#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" -+#define STANDARD_STARTFILE_PREFIX_2 "" - #endif - - #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */ diff --git a/nix/nixcrpkgs/mingw-w64/gcc/ubsan.patch b/nix/nixcrpkgs/mingw-w64/gcc/ubsan.patch deleted file mode 100644 index 0ad3b79912..0000000000 --- a/nix/nixcrpkgs/mingw-w64/gcc/ubsan.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- gcc-6.3.0-orig/gcc/ubsan.c -+++ gcc-6.3.0/gcc/ubsan.c -@@ -1471,7 +1471,7 @@ - - expanded_location xloc = expand_location (loc); - if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0 -- || xloc.file == '\0' || xloc.file[0] == '\xff' -+ || xloc.file == NULL || xloc.file[0] == '\xff' - || xloc.file[1] == '\xff') - return false; diff --git a/nix/nixcrpkgs/mingw-w64/gcc/use-source-date-epoch.patch b/nix/nixcrpkgs/mingw-w64/gcc/use-source-date-epoch.patch deleted file mode 100644 index 65a5ab028c..0000000000 --- a/nix/nixcrpkgs/mingw-w64/gcc/use-source-date-epoch.patch +++ /dev/null @@ -1,52 +0,0 @@ -https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02210.html - -diff --git a/libcpp/macro.c b/libcpp/macro.c -index 1e0a0b5..a52e3cb 100644 ---- a/libcpp/macro.c -+++ b/libcpp/macro.c -@@ -349,14 +349,38 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node) - slow on some systems. */ - time_t tt; - struct tm *tb = NULL; -+ char *source_date_epoch; - -- /* (time_t) -1 is a legitimate value for "number of seconds -- since the Epoch", so we have to do a little dance to -- distinguish that from a genuine error. */ -- errno = 0; -- tt = time(NULL); -- if (tt != (time_t)-1 || errno == 0) -- tb = localtime (&tt); -+ /* Allow the date and time to be set externally by an exported -+ environment variable to enable reproducible builds. */ -+ source_date_epoch = getenv ("SOURCE_DATE_EPOCH"); -+ if (source_date_epoch) -+ { -+ errno = 0; -+ tt = (time_t) strtol (source_date_epoch, NULL, 10); -+ if (errno == 0) -+ { -+ tb = gmtime (&tt); -+ if (tb == NULL) -+ cpp_error (pfile, CPP_DL_ERROR, -+ "SOURCE_DATE_EPOCH=\"%s\" is not a valid date", -+ source_date_epoch); -+ } -+ else -+ cpp_error (pfile, CPP_DL_ERROR, -+ "SOURCE_DATE_EPOCH=\"%s\" is not a valid number", -+ source_date_epoch); -+ } -+ else -+ { -+ /* (time_t) -1 is a legitimate value for "number of seconds -+ since the Epoch", so we have to do a little dance to -+ distinguish that from a genuine error. */ -+ errno = 0; -+ tt = time(NULL); -+ if (tt != (time_t)-1 || errno == 0) -+ tb = localtime (&tt); -+ } - - if (tb) - { diff --git a/nix/nixcrpkgs/mingw-w64/guid-selectany.patch b/nix/nixcrpkgs/mingw-w64/guid-selectany.patch deleted file mode 100644 index b495a67b52..0000000000 --- a/nix/nixcrpkgs/mingw-w64/guid-selectany.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 339371eafd2fb2bcbf8b0a08e5328fc7c16b892f Mon Sep 17 00:00:00 2001 -From: David Grayson -Date: Thu, 4 May 2017 06:41:28 -0700 -Subject: [PATCH] guiddef.h: Use __declspec(selectany) on GUID declarations. - -If __declspec(selectany) is not used on the prototype but later used -on a definition, GCC 6+ seems to ignore it, and you can get -multiple-definition errors at link time. - -That situation can arise in code like Microsoft's usbview utility that -has multiple translation units including the following headers in this -order: windows.h, initguid.h, winioctl.h. - -However, this patch cannot be upstreamed to mingw-w64 because it -breaks older versions of GCC, and MSDN says that putting selectany on -a declaration is "incorrect". Once GCC is fixed, we can remove this -patch. ---- - mingw-w64-headers/include/guiddef.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/mingw-w64-headers/include/guiddef.h b/mingw-w64-headers/include/guiddef.h -index 9ecea3e2..6c9444cf 100644 ---- a/mingw-w64-headers/include/guiddef.h -+++ b/mingw-w64-headers/include/guiddef.h -@@ -58,8 +58,7 @@ __extension__ template const GUID &__mingw_uuidof(); - #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } - #endif - #else --/* __declspec(selectany) must be applied to initialized objects on GCC 5 hence must not be used here. */ --#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name -+#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name - #endif - - #define DEFINE_OLEGUID(name, l, w1, w2) DEFINE_GUID (name, l, w1, w2, 0xc0, 0, 0, 0, 0, 0, 0, 0x46) --- -2.12.1 - diff --git a/nix/nixcrpkgs/mingw-w64/license_builder.sh b/nix/nixcrpkgs/mingw-w64/license_builder.sh deleted file mode 100644 index beb53ee270..0000000000 --- a/nix/nixcrpkgs/mingw-w64/license_builder.sh +++ /dev/null @@ -1,42 +0,0 @@ -source $setup - -tar -xf $gcc_src -mv gcc-* gcc - -license_gcc=$(cat gcc/COPYING3.LIB) -cd $src -license_runtime=$(cat COPYING.MinGW-w64-runtime/COPYING.MinGW-w64-runtime.txt) -license_winpthread=$(cat mingw-w64-libraries/winpthreads/COPYING) - -cat > $out < - The third-party software included with this software may - have been patched or otherwise modified. -

- -

GCC run-time libraries

- -

- The GCC run-time libraries libgcc and libstdc++ are licensed under the GNU - General Public License Version 3 (GPLv3) as shown below. -

- -
-$license_gcc
-
- -

MinGW-w64 runtime components

- -
-$license_runtime
-
- -

- libwinpthread also comes from the mingw-w64 project and its license is below. -

- -
-$license_winpthread
-
- -EOF diff --git a/nix/nixcrpkgs/mingw-w64/usb.patch b/nix/nixcrpkgs/mingw-w64/usb.patch deleted file mode 100644 index 768c4a9791..0000000000 --- a/nix/nixcrpkgs/mingw-w64/usb.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/mingw-w64-headers/include/usbspec.h b/mingw-w64-headers/include/usbspec.h -index 86557d8d..97ab5f3b 100644 ---- a/mingw-w64-headers/include/usbspec.h -+++ b/mingw-w64-headers/include/usbspec.h -@@ -213,6 +213,13 @@ typedef struct _USB_BOS_DESCRIPTOR { - #define USB_DEVICE_CAPABILITY_USB20_EXTENSION 0x02 - #define USB_DEVICE_CAPABILITY_SUPERSPEED_USB 0x03 - #define USB_DEVICE_CAPABILITY_CONTAINER_ID 0x04 -+#define USB_DEVICE_CAPABILITY_PLATFORM 0x05 -+#define USB_DEVICE_CAPABILITY_POWER_DELIVERY 0x06 -+#define USB_DEVICE_CAPABILITY_BATTERY_INFO 0x07 -+#define USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT 0x08 -+#define USB_DEVICE_CAPABILITY_PD_PROVIDER_PORT 0x09 -+#define USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB 0x0A -+#define USB_DEVICE_CAPABILITY_PRECISION_TIME_MEASUREMENT 0x0B - #define USB_DEVICE_CAPABILITY_BILLBOARD 0x0D - - typedef struct _USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR { -@@ -666,6 +673,54 @@ typedef struct _USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR { - ULONG dwBytesPerInterval; - } USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR,*PUSB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR; - -+typedef union _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED { -+ ULONG AsUlong32; -+ struct { -+ ULONG SublinkSpeedAttrID:4; -+ ULONG LaneSpeedExponent:2; -+ ULONG SublinkTypeMode:1; -+ ULONG SublinkTypeDir:1; -+ ULONG Reserved:6; -+ ULONG LinkProtocol:2; -+ ULONG LaneSpeedMantissa:16; -+ }; -+} USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED, *PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED; -+ -+typedef struct _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR { -+ UCHAR bLength; -+ UCHAR bDescriptorType; -+ UCHAR bDevCapabilityType; -+ UCHAR bReserved; -+ union { -+ ULONG AsUlong; -+ struct { -+ ULONG SublinkSpeedAttrCount:5; -+ ULONG SublinkSpeedIDCount:4; -+ ULONG Reserved:23; -+ }; -+ } bmAttributes; -+ union { -+ USHORT AsUshort; -+ struct { -+ USHORT SublinkSpeedAttrID:4; -+ USHORT Reserved:4; -+ USHORT MinRxLaneCount:4; -+ USHORT MinTxLaneCount:4; -+ }; -+ } wFunctionalitySupport; -+ USHORT wReserved; -+ USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED bmSublinkSpeedAttr[1]; -+} USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR,*PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR; -+ -+typedef struct _USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR { -+ UCHAR bLength; -+ UCHAR bDescriptorType; -+ UCHAR bDevCapabilityType; -+ UCHAR bReserved; -+ GUID PlatformCapabilityUuid; -+ UCHAR CapabililityData[1]; -+} USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR,*PUSB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR; -+ - #include - - #endif diff --git a/nix/nixcrpkgs/native/default.nix b/nix/nixcrpkgs/native/default.nix deleted file mode 100644 index e56c5ce5c5..0000000000 --- a/nix/nixcrpkgs/native/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ nixpkgs }: - -let - native_base = { - inherit nixpkgs; - - is_cross = false; - - default_native_inputs = [ - nixpkgs.bashInteractive - nixpkgs.binutils - (nixpkgs.binutils-unwrapped or nixpkgs.binutils) - nixpkgs.bzip2 - nixpkgs.cmake - nixpkgs.coreutils - nixpkgs.diffutils - nixpkgs.findutils - nixpkgs.gcc - nixpkgs.gawk - nixpkgs.gnumake - nixpkgs.gnugrep - nixpkgs.gnused - nixpkgs.gnutar - nixpkgs.gzip - nixpkgs.ninja - nixpkgs.patch - nixpkgs.which - nixpkgs.xz - ]; - - make_derivation = import ../make_derivation.nix native_base; - }; - - pkgconf = import ./pkgconf { env = native_base; }; - - wrappers = import ./wrappers { env = native_base; }; - - gnu_config = nixpkgs.fetchgit { - url = "https://git.savannah.gnu.org/git/config.git"; - rev = "81497f5aaf50a12a9fe0cba30ef18bda46b62959"; - sha256 = "1fq0nki2118zwbc8rdkqx5i04lbfw7gqbsyf5bscg5im6sfphq1d"; - }; - - native = native_base // { - default_native_inputs = native_base.default_native_inputs ++ [ - pkgconf - ]; - - inherit pkgconf wrappers gnu_config; - - make_derivation = import ../make_derivation.nix native; - }; - -in native diff --git a/nix/nixcrpkgs/native/pkgconf/builder.sh b/nix/nixcrpkgs/native/pkgconf/builder.sh deleted file mode 100644 index e58ccf98a9..0000000000 --- a/nix/nixcrpkgs/native/pkgconf/builder.sh +++ /dev/null @@ -1,21 +0,0 @@ -source $setup - -tar -xf $src - -mkdir build - -cd build - -../pkgconf-$version/configure \ - --prefix=$out \ - --with-system-libdir=/no-system-libdir/ \ - --with-system-includedir=/no-system-includedir/ - -make - -make install - -ln -s $out/bin/pkgconf $out/bin/pkg-config - -mkdir $out/license -cp ../pkgconf-$version/COPYING $out/license/LICENSE diff --git a/nix/nixcrpkgs/native/pkgconf/default.nix b/nix/nixcrpkgs/native/pkgconf/default.nix deleted file mode 100644 index cd7eea7bd4..0000000000 --- a/nix/nixcrpkgs/native/pkgconf/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ env }: - -env.make_derivation rec { - name = "pkgconf-${version}"; - - version = "1.0.1"; - - src = env.nixpkgs.fetchurl { - url = "https://github.com/pkgconf/pkgconf/releases/download/pkgconf-${version}/pkgconf-${version}.tar.gz"; - sha256 = "1w9wb2z7zz6s4mifbllvhx0401bwsynhp02v312i6i9jn1m2zkj5"; - }; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/native/wrappers/builder.sh b/nix/nixcrpkgs/native/wrappers/builder.sh deleted file mode 100644 index 64d149cef2..0000000000 --- a/nix/nixcrpkgs/native/wrappers/builder.sh +++ /dev/null @@ -1,17 +0,0 @@ -source $setup - -mkdir -p $out/bin - -cat > $out/bin/pkg-config-cross < $out/bin/cmake-cross < $out/gdbcmd.txt -set substitute-path ../samples src/angle/samples -set substitute-path ../util src/angle/util -EOF diff --git a/nix/nixcrpkgs/pkgs/angle/default.nix b/nix/nixcrpkgs/pkgs/angle/default.nix deleted file mode 100644 index da5a76c37e..0000000000 --- a/nix/nixcrpkgs/pkgs/angle/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ crossenv, gdb, debug ? false }: - -if crossenv.os != "windows" then "" else - -let - angle = import ./lib.nix { - inherit crossenv debug; - }; - - util = import ./util.nix { - inherit crossenv angle; - }; - - examples = import ./examples.nix { - inherit crossenv angle; - angle_util = util; - }; - - debug_bundle = import ./debug_bundle.nix { - inherit crossenv gdb angle examples; - }; - -in angle // { inherit util examples debug_bundle; } diff --git a/nix/nixcrpkgs/pkgs/angle/examples.nix b/nix/nixcrpkgs/pkgs/angle/examples.nix deleted file mode 100644 index 6ccb47f051..0000000000 --- a/nix/nixcrpkgs/pkgs/angle/examples.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ crossenv, angle, angle_util }: - -crossenv.make_derivation rec { - name = "angle-samples-${angle.version}"; - - src = angle.src; - - inherit angle angle_util; - - builder = ./samples_builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/angle/lib.nix b/nix/nixcrpkgs/pkgs/angle/lib.nix deleted file mode 100644 index 7357d905fa..0000000000 --- a/nix/nixcrpkgs/pkgs/angle/lib.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ crossenv, debug ? false }: - -if crossenv.os != "windows" then "windows only" else - -crossenv.make_derivation rec { - name = "angle-${version}"; - - version = "2017-03-09"; - - src = crossenv.nixpkgs.fetchgit { - url = "https://chromium.googlesource.com/angle/angle"; - rev = "fe9306a8e5bb6a8d52368e8e7b8e92f3bc7e77d4"; - sha256 = "0m2pbkl9x9kybcxzhai0s3bk9k0r8nb531gzlxcvb3gb2za388bn"; - }; - - patches = [ ./megapatch.patch ]; - - builder = ./builder.sh; - - native_inputs = [ - crossenv.nixpkgs.pythonPackages.gyp - ]; - - GYP_GENERATORS = "ninja"; - - gyp_flags = - "-D OS=win " + - "-D TARGET=win32 " + - "-D use_ozone=0 " + - "-D angle_enable_vulkan=0 " + # Vulkan support is in progress - "-D angle_gl_library_type=static_library " + - "-I ../src/gyp/common.gypi " + - "--depth ."; - - CC_target = "${crossenv.host}-gcc"; - CXX_target = "${crossenv.host}-g++"; - AR = "${crossenv.host}-ar"; - RANLIB = "${crossenv.host}-ranlib"; - - CXXFLAGS = "-msse2 -Wno-conversion-null"; - - inherit debug; -} diff --git a/nix/nixcrpkgs/pkgs/angle/megapatch.patch b/nix/nixcrpkgs/pkgs/angle/megapatch.patch deleted file mode 100644 index 319b192a70..0000000000 --- a/nix/nixcrpkgs/pkgs/angle/megapatch.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur angle-src-orig/src/angle.gyp angle-src/src/angle.gyp ---- angle-src-orig/src/angle.gyp 2017-02-07 07:42:35.090343332 -0800 -+++ angle-src/src/angle.gyp 2017-02-09 08:44:52.752006998 -0800 -@@ -286,7 +286,7 @@ - } - ] - }], -- ['OS=="win"', -+ ['OS=="win" and 0', - { - 'targets': - [ -diff -ur angle-src-orig/src/libGLESv2.gypi angle-src/src/libGLESv2.gypi ---- angle-src-orig/src/libGLESv2.gypi 2017-02-07 07:42:35.113676666 -0800 -+++ angle-src/src/libGLESv2.gypi 2017-02-09 09:19:37.985340331 -0800 -@@ -1078,7 +1078,7 @@ - '<@(libangle_null_sources)', - ], - }], -- ['angle_build_winrt==0 and OS=="win"', -+ ['angle_build_winrt==0 and OS=="win" and 0', - { - 'dependencies': - [ diff --git a/nix/nixcrpkgs/pkgs/angle/samples_builder.sh b/nix/nixcrpkgs/pkgs/angle/samples_builder.sh deleted file mode 100644 index 3b89c9c0b1..0000000000 --- a/nix/nixcrpkgs/pkgs/angle/samples_builder.sh +++ /dev/null @@ -1,54 +0,0 @@ -source $setup - -cp -r $src/samples . -cp -r $src/util . - -mkdir include -cp -r $src/samples/sample_util/* include/ - -mkdir build -cd build -mkdir bin - -CFLAGS="-mwindows -g -O2 -I../include -I$angle_util/include -I$angle/include" -CFLAGS="$CFLAGS -DGL_APICALL= -DANGLE_EXPORT= -DGL_GLEXT_PROTOTYPES" -LDFLAGS="-L$angle_util/lib -L$angle/lib" -LIBS="-langle_util -lEGL_static -lGLESv2_static -lANGLE -ltranslator --lpreprocessor -langle_image_util -langle_common -ld3d9 -lgdi32" - -echo "compiling texture_wrap" -$host-g++ $CFLAGS $LDFLAGS \ - ../samples/texture_wrap/TextureWrap.cpp \ - ../samples/sample_util/texture_utils.cpp \ - ../samples/sample_util/SampleApplication.cpp \ - $LIBS -o bin/texture_wrap${exe_suffix} - -echo "compiling simple_texture_2d" -$host-g++ $CFLAGS $LDFLAGS \ - ../samples/simple_texture_2d/SimpleTexture2D.cpp \ - ../samples/sample_util/texture_utils.cpp \ - ../samples/sample_util/SampleApplication.cpp \ - $LIBS -o bin/simple_texture_2d${exe_suffix} - -echo "compiling particle_system" -$host-g++ $CFLAGS $LDFLAGS \ - ../samples/particle_system/ParticleSystem.cpp \ - ../samples/sample_util/tga_utils.cpp \ - ../samples/sample_util/SampleApplication.cpp \ - $LIBS -o bin/particle_system${exe_suffix} -cp ../samples/particle_system/smoke.tga bin/ - -echo "compiling hello_triangle" -$host-g++ $CFLAGS $LDFLAGS \ - ../samples/hello_triangle/HelloTriangle.cpp \ - ../samples/sample_util/SampleApplication.cpp \ - $LIBS -o bin/hello_triangle${exe_suffix} - -echo "compiling window_test" -$host-g++ $CFLAGS $LDFLAGS \ - ../samples/WindowTest/WindowTest.cpp \ - -langle_util -lgdi32 -o bin/window_test${exe_suffix} - -mkdir -p $out/license -cp $src/LICENSE $out/license/ -cp -r bin $out/ diff --git a/nix/nixcrpkgs/pkgs/angle/util.nix b/nix/nixcrpkgs/pkgs/angle/util.nix deleted file mode 100644 index 83d7038820..0000000000 --- a/nix/nixcrpkgs/pkgs/angle/util.nix +++ /dev/null @@ -1,15 +0,0 @@ -# libangle_util is a helper library for programs like tests -# and samples that surround ANGLE but that are not the ANGLE libraries -# themselves - -{ crossenv, angle }: - -crossenv.make_derivation rec { - name = "angle_util-${angle.version}"; - - src = angle.src; - - inherit angle; - - builder = ./util_builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/angle/util_builder.sh b/nix/nixcrpkgs/pkgs/angle/util_builder.sh deleted file mode 100644 index 7929083b6e..0000000000 --- a/nix/nixcrpkgs/pkgs/angle/util_builder.sh +++ /dev/null @@ -1,38 +0,0 @@ -source $setup - -cp -r $src/util . - -mkdir include -cp -r $src/util/*.h include/ -cp -r $src/include/export.h include/ -mkdir include/common -cp -r $src/src/common/*.h include/common/ -mkdir -p include/windows/win32 -cp -r $src/util/windows/*.h include/windows/ -cp -r $src/util/windows/win32/*.h include/windows/win32/ - -mkdir -p build/{obj,lib} -cd build - -source_files=../util/*.cpp - -if [ "$os" == "windows" ]; then - source_files="$source_files ../util/windows/*.cpp ../util/windows/win32/*.cpp" -fi - -for c in $source_files; do - echo "compiling $(basename $c)" - $host-g++ -c -g -O2 -fpermissive \ - -I../include -I"$angle/include" -L"$angle/lib" \ - -DGL_APICALL= -DANGLE_EXPORT= -DEGLAPI= \ - -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES -DLIBANGLE_UTIL_IMPLEMENTATION \ - $c -lGLESv2 -lEGL \ - -o obj/$(basename $c).o -done - -$host-ar r lib/libangle_util.a obj/*.o - -mkdir -p $out/{license,lib} -cp $src/LICENSE $out/license/ -cp lib/libangle_util.a $out/lib/ -cp -r ../include $out/ diff --git a/nix/nixcrpkgs/pkgs/at-spi2-headers/builder.sh b/nix/nixcrpkgs/pkgs/at-spi2-headers/builder.sh deleted file mode 100644 index 04ac14fda5..0000000000 --- a/nix/nixcrpkgs/pkgs/at-spi2-headers/builder.sh +++ /dev/null @@ -1,12 +0,0 @@ -source $setup - -mkdir -p $out/include/atspi $out/lib/pkgconfig - -cp $src/atspi/*.h $out/include/atspi/ - -cat > $out/lib/pkgconfig/atspi-2.pc < $out <at-spi2-headers -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/avrdude/builder.sh b/nix/nixcrpkgs/pkgs/avrdude/builder.sh deleted file mode 100644 index 8c7f2c078f..0000000000 --- a/nix/nixcrpkgs/pkgs/avrdude/builder.sh +++ /dev/null @@ -1,23 +0,0 @@ -source $setup - -tar -xf $src -mv avrdude-* avrdude - -ls -lad avrdude -cd avrdude -chmod -R u+w . -cp $config_dot_sub config.sub -cat $extra_conf >> avrdude.conf.in -cd .. - -mkdir build -cd build - -../avrdude/configure --host=$host --prefix=$out \ - --enable-static \ - --disable-shared \ - --disable-dependency-tracking - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/avrdude/config.sub b/nix/nixcrpkgs/pkgs/avrdude/config.sub deleted file mode 100644 index 1d8e98bcee..0000000000 --- a/nix/nixcrpkgs/pkgs/avrdude/config.sub +++ /dev/null @@ -1,1801 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2018 Free Software Foundation, Inc. - -timestamp='2018-02-22' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS - -Canonicalize a configuration name. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2018 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo "$1" - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo "$1" | sed 's/-[^-]*$//'` - if [ "$basic_machine" != "$1" ] - then os=`echo "$1" | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia16 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | wasm32 \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | wasm32-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-pc - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2*) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - nsv-tandem) - basic_machine=nsv-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - x64) - basic_machine=x86_64-pc - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases that might get confused - # with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # es1800 is here to avoid being matched by es* (a different OS) - -es1800*) - os=-ose - ;; - # Now accept the basic system types. - # The portable systems comes first. - # Each alternative MUST end in a * to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ - | -midnightbsd*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -xray | -os68k* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo "$os" | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo "$os" | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo "$os" | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4*) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -pikeos*) - # Until real need of OS specific support for - # particular features comes up, bare metal - # configurations are quite functional. - case $basic_machine in - arm*) - os=-eabi - ;; - *) - os=-elf - ;; - esac - ;; - -nacl*) - ;; - -ios) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - pru-*) - os=-elf - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` - ;; -esac - -echo "$basic_machine$os" -exit - -# Local variables: -# eval: (add-hook 'write-file-functions 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/nix/nixcrpkgs/pkgs/avrdude/default.nix b/nix/nixcrpkgs/pkgs/avrdude/default.nix deleted file mode 100644 index d5442cc907..0000000000 --- a/nix/nixcrpkgs/pkgs/avrdude/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -# TODO: remove giveio.sys and any other sketchy drivers or binaries from the source - -# Note: There are no patches to help AVRDUDE find its configuration -# file, so it will expect that file to be at -# /nix/store/...-avrdude/etc/avrdude.conf - -{ crossenv }: - -crossenv.make_derivation rec { - name = "avrdude-${version}"; - - version = "6.3"; # February 2016 - - src = crossenv.nixpkgs.fetchurl { - url = "http://download.savannah.gnu.org/releases/avrdude/avrdude-${version}.tar.gz"; - sha256 = "15m1w1qad3dj7r8n5ng1qqcaiyx1gyd6hnc3p2apgjllccdp77qg"; - }; - - native_inputs = [ - crossenv.nixpkgs.yacc - crossenv.nixpkgs.flex - ]; - - cross_inputs = [ - # TODO: libusb - # TODO: libftdi - # TODO: libelf - # TODO: libhid - ]; - - config_dot_sub = ./config.sub; - extra_conf = ./extra.conf; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/avrdude/extra.conf b/nix/nixcrpkgs/pkgs/avrdude/extra.conf deleted file mode 100644 index 539cd65f4c..0000000000 --- a/nix/nixcrpkgs/pkgs/avrdude/extra.conf +++ /dev/null @@ -1,6 +0,0 @@ -part parent "m328p" - id = "m328pb"; - desc = "ATmega328PB"; - signature = 0x1e 0x95 0x16; - ocdrev = 1; -; \ No newline at end of file diff --git a/nix/nixcrpkgs/pkgs/curl/builder.sh b/nix/nixcrpkgs/pkgs/curl/builder.sh deleted file mode 100644 index 303f6278e6..0000000000 --- a/nix/nixcrpkgs/pkgs/curl/builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $setup - -tar -xf $src -cd * - -export CFLAGS=-fPIC - -case $host in - *darwin*) CFLAGS="$CFLAGS -mmacosx-version-min=10.11";; -esac - -./configure --prefix=$out --host=$host $configureFlags - -make -make install diff --git a/nix/nixcrpkgs/pkgs/curl/default.nix b/nix/nixcrpkgs/pkgs/curl/default.nix deleted file mode 100644 index 8268e288ed..0000000000 --- a/nix/nixcrpkgs/pkgs/curl/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ crossenv, openssl, zlib }: - -crossenv.make_derivation rec { - name = "curl-${version}"; - version = "7.62.0"; - - cross_inputs = [ crossenv.nixpkgs.perl ]; - native_inputs = [ zlib openssl ]; - builder = ./builder.sh; - - configureFlags = [ - "--disable-shared" - "--disable-manual" - "--disable-ldap" - "--with-ssl=${openssl}" - ]; - - src = crossenv.nixpkgs.fetchurl { - url = "https://curl.haxx.se/download/${name}.tar.bz2"; - sha256 = "084niy7cin13ba65p8x38w2xcyc54n3fgzbin40fa2shfr0ca0kq"; - }; -} diff --git a/nix/nixcrpkgs/pkgs/dejavu-fonts/builder.sh b/nix/nixcrpkgs/pkgs/dejavu-fonts/builder.sh deleted file mode 100644 index 1161ce85ab..0000000000 --- a/nix/nixcrpkgs/pkgs/dejavu-fonts/builder.sh +++ /dev/null @@ -1,6 +0,0 @@ -source $setup - -tar -xf $src -cd dejavu-* -mkdir $out -cp -r * $out/ diff --git a/nix/nixcrpkgs/pkgs/dejavu-fonts/default.nix b/nix/nixcrpkgs/pkgs/dejavu-fonts/default.nix deleted file mode 100644 index bd8a9d7436..0000000000 --- a/nix/nixcrpkgs/pkgs/dejavu-fonts/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ crossenv }: - -let - version = "2.37"; - - name = "dejavu-fonts-${version}"; - - src = crossenv.nixpkgs.fetchurl { - # Sourceforge went down. The original URL was: - # http://sourceforge.net/projects/dejavu/files/dejavu/${version}/dejavu-fonts-ttf-${version}.tar.bz2"; - url = "https://files.tmphax.com/repo1/dejavu-fonts-ttf-${version}.tar.bz2"; - sha256 = "1mqpds24wfs5cmfhj57fsfs07mji2z8812i5c4pi5pbi738s977s"; - }; - - fonts = crossenv.native.make_derivation { - inherit version name src; - builder = ./builder.sh; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = { "${name}" = license; }; - -in - fonts // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/dejavu-fonts/license_builder.sh b/nix/nixcrpkgs/pkgs/dejavu-fonts/license_builder.sh deleted file mode 100644 index 4ba33030b2..0000000000 --- a/nix/nixcrpkgs/pkgs/dejavu-fonts/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv dejavu-* dejavu - -license=$(cat dejavu/LICENSE) - -cat > $out <DejaVu Fonts - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/devcon/builder.sh b/nix/nixcrpkgs/pkgs/devcon/builder.sh deleted file mode 100644 index 166abe2ad0..0000000000 --- a/nix/nixcrpkgs/pkgs/devcon/builder.sh +++ /dev/null @@ -1,26 +0,0 @@ -source $setup - -cp --no-preserve=mode -r $src/setup/devcon . - -cd devcon -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done -$host-windmc msg.mc -cd .. - -mkdir build -cd build - -$host-windres ../devcon/devcon.rc rc.o - -$host-g++ -municode -O2 \ - -DUNICODE -D_UNICODE \ - ../devcon/*.cpp rc.o \ - -lsetupapi -lole32 \ - -o devcon.exe - -mkdir -p $out/bin $out/license -cp devcon.exe $out/bin -cp $src/LICENSE $out/license diff --git a/nix/nixcrpkgs/pkgs/devcon/default.nix b/nix/nixcrpkgs/pkgs/devcon/default.nix deleted file mode 100644 index e9410aee8b..0000000000 --- a/nix/nixcrpkgs/pkgs/devcon/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ crossenv }: - -if crossenv.os != "windows" then "windows only" else - -crossenv.make_derivation rec { - name = "devcon-${version}"; - - version = "2017-05-01"; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "Microsoft"; - repo = "Windows-driver-samples"; - rev = "4c5c5e0297c7a61e151f92af702cdac650a14489"; - sha256 = "1drq26bnad98xqn805qx0b6g4y65lmrdj7v40b3jhhzdsp8993pf"; - }; - - patches = []; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/devcon/my_xmlhelper.c b/nix/nixcrpkgs/pkgs/devcon/my_xmlhelper.c deleted file mode 100644 index 0cdf29140b..0000000000 --- a/nix/nixcrpkgs/pkgs/devcon/my_xmlhelper.c +++ /dev/null @@ -1,47 +0,0 @@ -#include "xmlhelper.h" - -EXTERN_C HRESULT InitXmlHelper() -{ - return 0; -} - -EXTERN_C HRESULT ReleaseXmlWriter() -{ - return 0; -} - -EXTERN_C HRESULT SaveXml(LPTSTR szfileName, DWORD dwCreationDisposition) -{ - MessageBox(NULL, - "Sorry, XML saving is not supported in this build.", - "XML not supported", - MB_OK | MB_ICONEXCLAMATION); - return 0; -} - -EXTERN_C HRESULT XmlAddHostController( - PSTR hcName, - PUSBHOSTCONTROLLERINFO hcInfo - ) -{ - return 0; -} - -EXTERN_C HRESULT XmlAddRootHub(PSTR rhName, PUSBROOTHUBINFO rhInfo) -{ - return 0; -} - -EXTERN_C HRESULT XmlAddExternalHub(PSTR ehName, PUSBEXTERNALHUBINFO ehInfo) -{ - return 0; -} - -EXTERN_C HRESULT XmlAddUsbDevice(PSTR devName, PUSBDEVICEINFO deviceInfo) -{ - return 0; -} - -EXTERN_C VOID XmlNotifyEndOfNodeList(PVOID pContext) -{ -} diff --git a/nix/nixcrpkgs/pkgs/expat/builder.sh b/nix/nixcrpkgs/pkgs/expat/builder.sh deleted file mode 100644 index 3a8bfb7312..0000000000 --- a/nix/nixcrpkgs/pkgs/expat/builder.sh +++ /dev/null @@ -1,26 +0,0 @@ -source $setup - -tar -xf $src - -cd expat-$version -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done -cd .. - -mkdir build -cd build - -../expat-$version/configure \ - --prefix=$out --host=$host \ - --enable-static --disable-shared - -make - -make install - -mv $out/bin/xmlwf $out/bin/xmlwf.exe - -mkdir $out/license -cp ../expat-$version/COPYING $out/license/LICENSE diff --git a/nix/nixcrpkgs/pkgs/expat/cve-2016-0718.patch b/nix/nixcrpkgs/pkgs/expat/cve-2016-0718.patch deleted file mode 100644 index 6d66fec0c7..0000000000 --- a/nix/nixcrpkgs/pkgs/expat/cve-2016-0718.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 3e6190e433479e56f8c1e5adc1198b3c86b15577 Mon Sep 17 00:00:00 2001 -From: Sebastian Pipping -Date: Sun, 17 Jul 2016 20:22:29 +0200 -Subject: [PATCH] Fix regression introduced by patch to CVE-2016-0718 (bug - #539) - -Tag names were cut off in some cases; reported by Andy Wang ---- - expat/lib/xmlparse.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c -index 13e080d..2630310 100644 ---- expat/lib/xmlparse.c -+++ expat-fixed/lib/xmlparse.c -@@ -2430,7 +2430,7 @@ doContent(XML_Parser parser, - &fromPtr, rawNameEnd, - (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1); - convLen = (int)(toPtr - (XML_Char *)tag->buf); -- if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) { -+ if ((fromPtr >= rawNameEnd) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) { - tag->name.strLen = convLen; - break; - } --- -2.9.2 diff --git a/nix/nixcrpkgs/pkgs/expat/default.nix b/nix/nixcrpkgs/pkgs/expat/default.nix deleted file mode 100644 index 860f540044..0000000000 --- a/nix/nixcrpkgs/pkgs/expat/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "expat-${version}"; - - version = "2.2.0"; - - src = crossenv.nixpkgs.fetchurl { - # Sourceforge went down. The original URL we used was: - # mirror://sourceforge/expat/expat-${version}.tar.bz2 - url = "https://files.tmphax.com/repo1/expat-${version}.tar.bz2"; - sha256 = "1zq4lnwjlw8s9mmachwfvfjf2x3lk24jm41746ykhdcvs7r0zrfr"; - }; - - patches = [ - ./cve-2016-0718.patch - ]; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/fixesproto/builder.sh b/nix/nixcrpkgs/pkgs/fixesproto/builder.sh deleted file mode 100644 index 4d91d6e9f3..0000000000 --- a/nix/nixcrpkgs/pkgs/fixesproto/builder.sh +++ /dev/null @@ -1,16 +0,0 @@ -source $setup - -cp -r $src src -chmod -R u+w src -cd src -autoreconf -v --install -cd .. - -mkdir build -cd build - -../src/configure --prefix=$out -make -make install - -ln -sf $xextproto/lib/pkgconfig/*.pc $out/lib/pkgconfig diff --git a/nix/nixcrpkgs/pkgs/fixesproto/default.nix b/nix/nixcrpkgs/pkgs/fixesproto/default.nix deleted file mode 100644 index 49936287eb..0000000000 --- a/nix/nixcrpkgs/pkgs/fixesproto/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ crossenv, xorg-macros, xextproto }: - -let - version = "2017-01-26"; - - name = "fixesproto-${version}"; - - src = crossenv.nixpkgs.fetchgit { - url = "https://anongit.freedesktop.org/git/xorg/proto/fixesproto"; - rev = "4292ec1c63180c5f4e7c0e606fa68c51913f172b"; - sha256 = "0mmx4cmkbrsmbq1j58g8gcx4h3qz9y4xbjpz7jcl7crki7zrz3kx"; - }; - - lib = crossenv.native.make_derivation rec { - inherit version name src; - - builder = ./builder.sh; - - native_inputs = [ - crossenv.nixpkgs.autoconf - crossenv.nixpkgs.automake - ]; - - ACLOCAL_PATH = "${xorg-macros}/lib/aclocal"; - - inherit xextproto; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - xorg-macros.license_set // - xextproto.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/fixesproto/license_builder.sh b/nix/nixcrpkgs/pkgs/fixesproto/license_builder.sh deleted file mode 100644 index 8e347c3613..0000000000 --- a/nix/nixcrpkgs/pkgs/fixesproto/license_builder.sh +++ /dev/null @@ -1,11 +0,0 @@ -source $setup - -license=$(cat $src/COPYING) - -cat > $out <fixesproto - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/gdb/builder.sh b/nix/nixcrpkgs/pkgs/gdb/builder.sh deleted file mode 100644 index 8133f5199d..0000000000 --- a/nix/nixcrpkgs/pkgs/gdb/builder.sh +++ /dev/null @@ -1,31 +0,0 @@ -source $setup - -tar -xf $src - -cd gdb-$version -for patch in $patches -do - echo applying patch $patch - patch -p1 -i $patch -done -cd .. - -mkdir build -cd build - -export LDFLAGS="-L$curses/lib" -export CFLAGS="-I$curses/include" -export CXXFLAGS="-I$curses/include" - -../gdb-$version/configure \ - --prefix=$out \ - --host=$host \ - --target=$host \ - --with-expat=yes --with-libexpat-prefix=$expat \ - --enable-tui \ - --disable-win32-registry \ - --disable-rpath - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/gdb/default.nix b/nix/nixcrpkgs/pkgs/gdb/default.nix deleted file mode 100644 index 43378cb681..0000000000 --- a/nix/nixcrpkgs/pkgs/gdb/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -# Note: This package has only been tested on Windows, and the pdcurses library -# it uses does not support Linux in console mode or mac OS X. - -# Note: GDB has a bundled copy of readline that it uses. -# There is a --with-system-readline option we could try to use. - -# Note: consider providing a mingw-w64 isl to gdb because its configure script looks for it - -{ crossenv, expat, curses }: - -crossenv.make_derivation rec { - name = "gdb-${version}"; - - version = "7.12.1"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://ftp.gnu.org/gnu/gdb/gdb-${version}.tar.xz"; - sha256 = "11ii260h1sd7v0bs3cz6d5l8gqxxgldry0md60ncjgixjw5nh1s6"; - }; - - patches = [ - # Make GCC better at finding source files. - # https://sourceware.org/ml/gdb-patches/2017-02/msg00693.html - ./substitute-path-all-filenames.patch - ]; - - native_inputs = [ - crossenv.nixpkgs.texinfo - crossenv.nixpkgs.bison - crossenv.nixpkgs.yacc - crossenv.nixpkgs.m4 - crossenv.nixpkgs.flex - ]; - - inherit expat curses; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/gdb/substitute-path-all-filenames.patch b/nix/nixcrpkgs/pkgs/gdb/substitute-path-all-filenames.patch deleted file mode 100644 index f1821a772d..0000000000 --- a/nix/nixcrpkgs/pkgs/gdb/substitute-path-all-filenames.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -ur gdb-7.12.1-orig/gdb/source.c gdb-7.12.1/gdb/source.c ---- gdb-7.12.1-orig/gdb/source.c 2017-02-24 19:33:13.340349333 -0800 -+++ gdb-7.12.1/gdb/source.c 2017-02-24 19:34:40.660349333 -0800 -@@ -1103,10 +1103,7 @@ - } - } - -- if (IS_ABSOLUTE_PATH (filename)) - { -- /* If filename is absolute path, try the source path -- substitution on it. */ - char *rewritten_filename = rewrite_source_path (filename); - - if (rewritten_filename != NULL) diff --git a/nix/nixcrpkgs/pkgs/hello/builder.sh b/nix/nixcrpkgs/pkgs/hello/builder.sh deleted file mode 100644 index 36c57adc7d..0000000000 --- a/nix/nixcrpkgs/pkgs/hello/builder.sh +++ /dev/null @@ -1,7 +0,0 @@ -source $setup - -$host-gcc $src_file -o hello$exe_suffix - -mkdir -p $out/bin - -cp hello$exe_suffix $out/bin/ diff --git a/nix/nixcrpkgs/pkgs/hello/default.nix b/nix/nixcrpkgs/pkgs/hello/default.nix deleted file mode 100644 index c8e4d5208a..0000000000 --- a/nix/nixcrpkgs/pkgs/hello/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "hello"; - src_file = ./hello.c; - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/hello/hello.c b/nix/nixcrpkgs/pkgs/hello/hello.c deleted file mode 100644 index 98e2277bc6..0000000000 --- a/nix/nixcrpkgs/pkgs/hello/hello.c +++ /dev/null @@ -1,15 +0,0 @@ -#include - -#ifdef _WIN32 -#include -#endif - -int main(int argc, char ** argv) -{ - printf("Hello, World!\n"); - -#ifdef _WIN32 - MessageBoxA(NULL, "Hello, World!", "Hello", MB_OK); -#endif - return 0; -} diff --git a/nix/nixcrpkgs/pkgs/hello_cpp/builder.sh b/nix/nixcrpkgs/pkgs/hello_cpp/builder.sh deleted file mode 100644 index dae159775d..0000000000 --- a/nix/nixcrpkgs/pkgs/hello_cpp/builder.sh +++ /dev/null @@ -1,8 +0,0 @@ -. $setup - -$host-g++ $src_file -o hello$exe_suffix - -mkdir -p $out/bin/ - -cp hello$exe_suffix $out/bin/ - diff --git a/nix/nixcrpkgs/pkgs/hello_cpp/default.nix b/nix/nixcrpkgs/pkgs/hello_cpp/default.nix deleted file mode 100644 index 8f35d0b6f0..0000000000 --- a/nix/nixcrpkgs/pkgs/hello_cpp/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "hello_cpp"; - src_file = ./hello.cpp; - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/hello_cpp/hello.cpp b/nix/nixcrpkgs/pkgs/hello_cpp/hello.cpp deleted file mode 100644 index d081ace709..0000000000 --- a/nix/nixcrpkgs/pkgs/hello_cpp/hello.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include - -#ifdef _WIN32 -#include -#endif - -int main(int argc, char ** argv) -{ - std::cout << "hello world" << std::endl; - -#ifdef _WIN32 - MessageBoxA(NULL, "Hello world", "Hello Box", MB_OK); -#endif - return 0; -} diff --git a/nix/nixcrpkgs/pkgs/inputproto/builder.sh b/nix/nixcrpkgs/pkgs/inputproto/builder.sh deleted file mode 100644 index ff349bbcd3..0000000000 --- a/nix/nixcrpkgs/pkgs/inputproto/builder.sh +++ /dev/null @@ -1,13 +0,0 @@ -source $setup - -tar -xf $src -mv inputproto-* proto - -mkdir build -cd build - -../proto/configure --prefix=$out - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/inputproto/default.nix b/nix/nixcrpkgs/pkgs/inputproto/default.nix deleted file mode 100644 index 7c384049dc..0000000000 --- a/nix/nixcrpkgs/pkgs/inputproto/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ crossenv }: - -let - version = "2.3.2"; - - name = "inputproto-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xorg.freedesktop.org/releases/individual/proto/inputproto-${version}.tar.bz2"; - sha256 = "07gk7v006zqn3dcfh16l06gnccy7xnqywf3vl9c209ikazsnlfl9"; - }; - - lib = crossenv.native.make_derivation rec { - inherit version name src; - builder = ./builder.sh; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/inputproto/license_builder.sh b/nix/nixcrpkgs/pkgs/inputproto/license_builder.sh deleted file mode 100644 index aad143efb6..0000000000 --- a/nix/nixcrpkgs/pkgs/inputproto/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv inputproto-* inputproto - -license=$(cat inputproto/COPYING) - -cat > $out <inputproto - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/ion/builder.sh b/nix/nixcrpkgs/pkgs/ion/builder.sh deleted file mode 100644 index 6ac7950a25..0000000000 --- a/nix/nixcrpkgs/pkgs/ion/builder.sh +++ /dev/null @@ -1,20 +0,0 @@ -source $setup - -tar -xf $src -mv bitwise-* bitwise - -mkdir build -cd build - -$host-gcc -O2 ../bitwise/ion/main.c -o ion$exe_suffix \ - -DIONHOME=\"$out/ionhome\" - -# TODO: make -DIONHOME actually work - -mkdir $out - -mkdir $out/bin -mv ion$exe_suffix $out/bin/ - -mkdir $out/ionhome -mv ../bitwise/ion/system_packages $out/ionhome/ diff --git a/nix/nixcrpkgs/pkgs/ion/default.nix b/nix/nixcrpkgs/pkgs/ion/default.nix deleted file mode 100644 index 222f6c8856..0000000000 --- a/nix/nixcrpkgs/pkgs/ion/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ crossenv }: - -# TODO: SDL integration would be nice, so we can use noir.ion - -let - version = "7524dc7"; # 2018-04-30 - - name = "ion-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://github.com/DavidEGrayson/bitwise/archive/${version}.tar.gz"; - sha256 = "169j7yhphvcyfbqgi5p1i4lhd9n5a31n99fv2kxyrh7djmr8g2s9"; - }; - - ion = crossenv.make_derivation { - inherit version name src; - builder = ./builder.sh; - }; - -in - ion diff --git a/nix/nixcrpkgs/pkgs/kbproto/builder.sh b/nix/nixcrpkgs/pkgs/kbproto/builder.sh deleted file mode 100644 index 3f21643e88..0000000000 --- a/nix/nixcrpkgs/pkgs/kbproto/builder.sh +++ /dev/null @@ -1,13 +0,0 @@ -source $setup - -tar -xf $src -mv kbproto-* proto - -mkdir build -cd build - -../proto/configure --prefix=$out - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/kbproto/default.nix b/nix/nixcrpkgs/pkgs/kbproto/default.nix deleted file mode 100644 index 6af2fcf908..0000000000 --- a/nix/nixcrpkgs/pkgs/kbproto/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ crossenv }: - -let - version = "1.0.7"; - - name = "kbproto-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xorg.freedesktop.org/releases/individual/proto/kbproto-${version}.tar.bz2"; - sha256 = "0mxqj1pzhjpz9495vrjnpi10kv2n1s4vs7di0sh3yvipfq5j30pq"; - }; - - lib = crossenv.native.make_derivation rec { - inherit version name src; - builder = ./builder.sh; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/kbproto/license_builder.sh b/nix/nixcrpkgs/pkgs/kbproto/license_builder.sh deleted file mode 100644 index 65776595af..0000000000 --- a/nix/nixcrpkgs/pkgs/kbproto/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv kbproto-* kbproto - -license=$(cat kbproto/COPYING) - -cat > $out <kbproto - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/libgmp/builder.sh b/nix/nixcrpkgs/pkgs/libgmp/builder.sh deleted file mode 100644 index c284c9a5f1..0000000000 --- a/nix/nixcrpkgs/pkgs/libgmp/builder.sh +++ /dev/null @@ -1,9 +0,0 @@ -source $setup - -tar -xf $src - -mkdir build -cd build -../gmp-$version/configure --host=$host --prefix=$out --disable-shared -make -make install diff --git a/nix/nixcrpkgs/pkgs/libgmp/default.nix b/nix/nixcrpkgs/pkgs/libgmp/default.nix deleted file mode 100644 index 52af7aefbc..0000000000 --- a/nix/nixcrpkgs/pkgs/libgmp/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "gmp-${version}"; - version = "6.1.2"; - builder = ./builder.sh; - native_inputs = [ crossenv.nixpkgs.m4 ]; - - src = crossenv.nixpkgs.fetchurl { - urls = [ "mirror://gnu/gmp/${name}.tar.bz2" - "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" - ]; - sha256 = "1clg7pbpk6qwxj5b2mw0pghzawp2qlm3jf9gdd8i6fl6yh2bnxaj"; - }; - -} diff --git a/nix/nixcrpkgs/pkgs/libsigsegv/builder.sh b/nix/nixcrpkgs/pkgs/libsigsegv/builder.sh deleted file mode 100644 index f5e7072de6..0000000000 --- a/nix/nixcrpkgs/pkgs/libsigsegv/builder.sh +++ /dev/null @@ -1,50 +0,0 @@ -source $setup - -tar -xf $src - -cd libsigsegv-$version -patch -p1 << 'PATCH_I386' ---- a/src/fault-linux-i386.h 2020-06-25 23:46:02.099235491 +0000 -+++ b/src/fault-linux-i386.h 2020-06-25 23:45:48.679156892 +0000 -@@ -18,6 +18,7 @@ - - #include "fault-posix-ucontext.h" - -+#define HAVE_STACKVMA 0 - #if defined __x86_64__ - /* 64 bit registers */ - -PATCH_I386 -patch -p1 << 'PATCH_ARM' ---- a/src/fault-linux-arm.h -+++ b/src/fault-linux-arm.h -@@ -17,6 +17,7 @@ - - #include "fault-posix-ucontext.h" - -+#define HAVE_STACKVMA 0 - #if defined(__aarch64__) || defined(__ARM_64BIT_STATE) || defined(__ARM_PCS_AAPCS64) /* 64-bit */ - - /* See glibc/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h. - -PATCH_ARM -cd .. - -mkdir build -cd build - -# Hack -if [ $host = aarch64-linux-musleabi ] -then - sed -i 's/^CFG_FAULT=$/CFG_FAULT=fault-linux-arm.h/' \ - ../libsigsegv-$version/configure -fi - -../libsigsegv-$version/configure \ - --host=$host \ - --prefix=$out \ - --enable-static=yes \ - --enable-shared=no - -make -make install diff --git a/nix/nixcrpkgs/pkgs/libsigsegv/default.nix b/nix/nixcrpkgs/pkgs/libsigsegv/default.nix deleted file mode 100644 index 60e8c7b6a8..0000000000 --- a/nix/nixcrpkgs/pkgs/libsigsegv/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "libsigsegv-${version}"; - version = "2.12"; - - src = crossenv.nixpkgs.fetchurl { - url = "mirror://gnu/libsigsegv/${name}.tar.gz"; - sha256 = "1dlhqf4igzpqayms25lkhycjq1ccavisx8cnb3y4zapbkqsszq9s"; - }; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/libudev/builder.sh b/nix/nixcrpkgs/pkgs/libudev/builder.sh deleted file mode 100644 index aad209a221..0000000000 --- a/nix/nixcrpkgs/pkgs/libudev/builder.sh +++ /dev/null @@ -1,71 +0,0 @@ -source $setup - -tar -xf $src -mv systemd-* systemd - -cd systemd -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done -cd .. - -$host-g++ -x c++ -c $size_flags - -o test.o < -#include -#include -static_assert(sizeof(pid_t) == SIZEOF_PID_T); -static_assert(sizeof(uid_t) == SIZEOF_UID_T); -static_assert(sizeof(gid_t) == SIZEOF_GID_T); -static_assert(sizeof(time_t) == SIZEOF_TIME_T); -static_assert(sizeof(rlim_t) == SIZEOF_RLIM_T); -static_assert(sizeof(dev_t) == SIZEOF_DEV_T); -static_assert(sizeof(ino_t) == SIZEOF_INO_T); -EOF - -rm test.o - -mkdir build -cd build - -# -DHAVE_SECURE_GETENV: We don't have secure_getenv but we want to avoid a header error, -# and hopefully secure_getenv isn't actually needed by libudev. - -$host-gcc -c -Werror -I$fill $fill/*.c -$host-gcc -c $CFLAGS \ - -I../systemd/src/libudev \ - -I../systemd/src/basic \ - -I../systemd/src/libsystemd/sd-device \ - -I../systemd/src/libsystemd/sd-hwdb \ - -I../systemd/src/systemd \ - ../systemd/src/libudev/*.c -$host-gcc -c $CFLAGS \ - -I../systemd/src/libsystemd/sd-device \ - -I../systemd/src/basic \ - -I../systemd/src/systemd \ - ../systemd/src/libsystemd/sd-device/{device-enumerator,device-private,sd-device}.c -$host-gcc -c $CFLAGS \ - -DPACKAGE_STRING="\"libudev $version\"" \ - -DFALLBACK_HOSTNAME="\"localhost\"" \ - -DDEFAULT_HIERARCHY_NAME="\"hybrid\"" \ - -DDEFAULT_HIERARCHY=CGROUP_UNIFIED_SYSTEMD \ - -I../systemd/src/basic \ - -I../systemd/src/systemd \ - -I$fill \ - ../systemd/src/basic/{alloc-util,architecture,bus-label,cgroup-util,device-nodes,dirent-util,env-util,escape,extract-word,fd-util,fileio,fs-util,gunicode,glob-util,hashmap,hash-funcs,hexdecoct,hostname-util,io-util,log,login-util,mempool,mkdir,path-util,proc-cmdline,parse-util,prioq,process-util,random-util,signal-util,siphash24,socket-util,stat-util,string-table,string-util,strv,strxcpyx,syslog-util,terminal-util,time-util,unit-name,user-util,utf8,util,virt,MurmurHash2}.c -$host-ar cr libudev.a *.o - -mkdir -p $out/lib/pkgconfig $out/include -cp libudev.a $out/lib/ -cp ../systemd/src/libudev/libudev.h $out/include/ - -cat > $out/lib/pkgconfig/libudev.pc < - - With parts from the musl C library - Copyright 2005-2014 Rich Felker, et al. - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include -#include -#include - -static const char *consume_nonarg(const char *fmt) -{ - do { - if (*fmt == '\0') - return fmt; - } while (*fmt++ != '%'); - return fmt; -} - -static const char *consume_num(const char *fmt) -{ - for (;*fmt >= '0' && *fmt <= '9'; fmt++) - /* do nothing */; - return fmt; -} - -static const char *consume_argn(const char *fmt, size_t *arg) -{ - const char *p = fmt; - size_t val = 0; - - if (*p < '1' || *p > '9') - return fmt; - do { - val = 10*val + (*p++ - '0'); - } while (*p >= '0' && *p <= '9'); - - if (*p != '$') - return fmt; - *arg = val; - return p+1; -} - -static const char *consume_flags(const char *fmt) -{ - while (1) { - switch (*fmt) { - case '#': - case '0': - case '-': - case ' ': - case '+': - case '\'': - case 'I': - fmt++; - continue; - } - return fmt; - } -} - -enum state { - BARE, - LPRE, - LLPRE, - HPRE, - HHPRE, - BIGLPRE, - ZTPRE, - JPRE, - STOP -}; - -enum type { - NONE, - PTR, - INT, - UINT, - ULLONG, - LONG, - ULONG, - SHORT, - USHORT, - CHAR, - UCHAR, - LLONG, - SIZET, - IMAX, - UMAX, - PDIFF, - UIPTR, - DBL, - LDBL, - MAXTYPE -}; - -static const short pa_types[MAXTYPE] = { - [NONE] = PA_INT, - [PTR] = PA_POINTER, - [INT] = PA_INT, - [UINT] = PA_INT, - [ULLONG] = PA_INT | PA_FLAG_LONG_LONG, - [LONG] = PA_INT | PA_FLAG_LONG, - [ULONG] = PA_INT | PA_FLAG_LONG, - [SHORT] = PA_INT | PA_FLAG_SHORT, - [USHORT] = PA_INT | PA_FLAG_SHORT, - [CHAR] = PA_CHAR, - [UCHAR] = PA_CHAR, - [LLONG] = PA_INT | PA_FLAG_LONG_LONG, - [SIZET] = PA_INT | PA_FLAG_LONG, - [IMAX] = PA_INT | PA_FLAG_LONG_LONG, - [UMAX] = PA_INT | PA_FLAG_LONG_LONG, - [PDIFF] = PA_INT | PA_FLAG_LONG_LONG, - [UIPTR] = PA_INT | PA_FLAG_LONG, - [DBL] = PA_DOUBLE, - [LDBL] = PA_DOUBLE | PA_FLAG_LONG_DOUBLE -}; - -#define S(x) [(x)-'A'] -#define E(x) (STOP + (x)) - -static const unsigned char states[]['z'-'A'+1] = { - { /* 0: bare types */ - S('d') = E(INT), S('i') = E(INT), - S('o') = E(UINT),S('u') = E(UINT),S('x') = E(UINT), S('X') = E(UINT), - S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL), - S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL), - S('c') = E(CHAR),S('C') = E(INT), - S('s') = E(PTR), S('S') = E(PTR), S('p') = E(UIPTR),S('n') = E(PTR), - S('m') = E(NONE), - S('l') = LPRE, S('h') = HPRE, S('L') = BIGLPRE, - S('z') = ZTPRE, S('j') = JPRE, S('t') = ZTPRE - }, { /* 1: l-prefixed */ - S('d') = E(LONG), S('i') = E(LONG), - S('o') = E(ULONG),S('u') = E(ULONG),S('x') = E(ULONG),S('X') = E(ULONG), - S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL), - S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL), - S('c') = E(INT), S('s') = E(PTR), S('n') = E(PTR), - S('l') = LLPRE - }, { /* 2: ll-prefixed */ - S('d') = E(LLONG), S('i') = E(LLONG), - S('o') = E(ULLONG),S('u') = E(ULLONG), - S('x') = E(ULLONG),S('X') = E(ULLONG), - S('n') = E(PTR) - }, { /* 3: h-prefixed */ - S('d') = E(SHORT), S('i') = E(SHORT), - S('o') = E(USHORT),S('u') = E(USHORT), - S('x') = E(USHORT),S('X') = E(USHORT), - S('n') = E(PTR), - S('h') = HHPRE - }, { /* 4: hh-prefixed */ - S('d') = E(CHAR), S('i') = E(CHAR), - S('o') = E(UCHAR),S('u') = E(UCHAR), - S('x') = E(UCHAR),S('X') = E(UCHAR), - S('n') = E(PTR) - }, { /* 5: L-prefixed */ - S('e') = E(LDBL),S('f') = E(LDBL),S('g') = E(LDBL), S('a') = E(LDBL), - S('E') = E(LDBL),S('F') = E(LDBL),S('G') = E(LDBL), S('A') = E(LDBL), - S('n') = E(PTR) - }, { /* 6: z- or t-prefixed (assumed to be same size) */ - S('d') = E(PDIFF),S('i') = E(PDIFF), - S('o') = E(SIZET),S('u') = E(SIZET), - S('x') = E(SIZET),S('X') = E(SIZET), - S('n') = E(PTR) - }, { /* 7: j-prefixed */ - S('d') = E(IMAX), S('i') = E(IMAX), - S('o') = E(UMAX), S('u') = E(UMAX), - S('x') = E(UMAX), S('X') = E(UMAX), - S('n') = E(PTR) - } -}; - -size_t parse_printf_format(const char *fmt, size_t n, int *types) -{ - size_t i = 0; - size_t last = 0; - - memset(types, 0, n); - - while (1) { - size_t arg; - unsigned int state; - - fmt = consume_nonarg(fmt); - if (*fmt == '\0') - break; - if (*fmt == '%') { - fmt++; - continue; - } - arg = 0; - fmt = consume_argn(fmt, &arg); - /* flags */ - fmt = consume_flags(fmt); - /* width */ - if (*fmt == '*') { - size_t warg = 0; - fmt = consume_argn(fmt+1, &warg); - if (warg == 0) - warg = ++i; - if (warg > last) - last = warg; - if (warg <= n && types[warg-1] == NONE) - types[warg-1] = INT; - } else - fmt = consume_num(fmt); - /* precision */ - if (*fmt == '.') { - fmt++; - if (*fmt == '*') { - size_t parg = 0; - fmt = consume_argn(fmt+1, &parg); - if (parg == 0) - parg = ++i; - if (parg > last) - last = parg; - if (parg <= n && types[parg-1] == NONE) - types[parg-1] = INT; - } else { - if (*fmt == '-') - fmt++; - fmt = consume_num(fmt); - } - } - /* length modifier and conversion specifier */ - state = BARE; - do { - unsigned char c = *fmt++; - - if (c < 'A' || c > 'z') - continue; - state = states[state]S(c); - if (state == 0) - continue; - } while (state < STOP); - - if (state == E(NONE)) - continue; - - if (arg == 0) - arg = ++i; - if (arg > last) - last = arg; - if (arg <= n) - types[arg-1] = state - STOP; - } - - if (last > n) - last = n; - for (i = 0; i < last; i++) - types[i] = pa_types[types[i]]; - - return last; -} diff --git a/nix/nixcrpkgs/pkgs/libudev/fill/printf.h b/nix/nixcrpkgs/pkgs/libudev/fill/printf.h deleted file mode 100644 index ee64bdca49..0000000000 --- a/nix/nixcrpkgs/pkgs/libudev/fill/printf.h +++ /dev/null @@ -1,50 +0,0 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - -/*** - This file is part of systemd. - - Copyright 2014 Emil Renner Berthing - - With parts from the GNU C Library - Copyright 1991-2014 Free Software Foundation, Inc. - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#pragma once - -#include - -enum { /* C type: */ - PA_INT, /* int */ - PA_CHAR, /* int, cast to char */ - PA_WCHAR, /* wide char */ - PA_STRING, /* const char *, a '\0'-terminated string */ - PA_WSTRING, /* const wchar_t *, wide character string */ - PA_POINTER, /* void * */ - PA_FLOAT, /* float */ - PA_DOUBLE, /* double */ - PA_LAST -}; - -/* Flag bits that can be set in a type returned by `parse_printf_format'. */ -#define PA_FLAG_MASK 0xff00 -#define PA_FLAG_LONG_LONG (1 << 8) -#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG -#define PA_FLAG_LONG (1 << 9) -#define PA_FLAG_SHORT (1 << 10) -#define PA_FLAG_PTR (1 << 11) - -size_t parse_printf_format(const char *fmt, size_t n, int *types); - diff --git a/nix/nixcrpkgs/pkgs/libudev/license_builder.sh b/nix/nixcrpkgs/pkgs/libudev/license_builder.sh deleted file mode 100644 index 9b612b976f..0000000000 --- a/nix/nixcrpkgs/pkgs/libudev/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv systemd-* systemd - -license=$(cat systemd/LICENSE.LGPL2.1) - -cat > $out <libudev (part of systemd) - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/libudev/megapatch.patch b/nix/nixcrpkgs/pkgs/libudev/megapatch.patch deleted file mode 100644 index a22af551f0..0000000000 --- a/nix/nixcrpkgs/pkgs/libudev/megapatch.patch +++ /dev/null @@ -1,102 +0,0 @@ -diff -ur systemd-234-orig/src/basic/glob-util.c systemd-234/src/basic/glob-util.c ---- systemd-234-orig/src/basic/glob-util.c 2017-07-17 19:46:03.031674662 -0700 -+++ systemd-234/src/basic/glob-util.c 2017-07-22 20:11:56.931514364 -0700 -@@ -31,22 +31,8 @@ - int safe_glob(const char *path, int flags, glob_t *pglob) { - int k; - -- /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */ -- assert(!(flags & GLOB_ALTDIRFUNC)); -- -- if (!pglob->gl_closedir) -- pglob->gl_closedir = (void (*)(void *)) closedir; -- if (!pglob->gl_readdir) -- pglob->gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot; -- if (!pglob->gl_opendir) -- pglob->gl_opendir = (void *(*)(const char *)) opendir; -- if (!pglob->gl_lstat) -- pglob->gl_lstat = lstat; -- if (!pglob->gl_stat) -- pglob->gl_stat = stat; -- - errno = 0; -- k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob); -+ k = glob(path, flags, NULL, pglob); - - if (k == GLOB_NOMATCH) - return -ENOENT; -@@ -66,7 +52,7 @@ - - assert(path); - -- k = safe_glob(path, GLOB_NOSORT|GLOB_BRACE, &g); -+ k = safe_glob(path, GLOB_NOSORT, &g); - if (k == -ENOENT) - return false; - if (k < 0) -@@ -78,7 +64,7 @@ - _cleanup_globfree_ glob_t g = {}; - int k; - -- k = safe_glob(path, GLOB_NOSORT|GLOB_BRACE, &g); -+ k = safe_glob(path, GLOB_NOSORT, &g); - if (k < 0) - return k; - -diff -ur systemd-234-orig/src/basic/missing.h systemd-234/src/basic/missing.h ---- systemd-234-orig/src/basic/missing.h 2017-07-17 19:46:03.031674662 -0700 -+++ systemd-234/src/basic/missing.h 2017-07-21 08:02:12.349505168 -0700 -@@ -40,6 +40,22 @@ - #include - #include - -+static __inline__ char * canonicalize_file_name(const char * path) -+{ -+ return realpath(path, NULL); -+} -+ -+static __inline__ char * strndupa(const char * s, size_t n) -+{ -+ size_t length = strnlen(s, n); -+ char * new_string = (char *)__builtin_alloca(length + 1); -+ new_string[length] = 0; -+ memcpy(new_string, s, length); -+ return new_string; -+} -+ -+typedef int comparison_fn_t(const void *, const void *); -+ - #ifdef HAVE_AUDIT - #include - #endif -@@ -550,7 +566,7 @@ - # ifdef HAVE___SECURE_GETENV - # define secure_getenv __secure_getenv - # else --# error "neither secure_getenv nor __secure_getenv are available" -+# define secure_getenv getenv - # endif - #endif - -diff -ur systemd-234-orig/src/basic/mkdir.c systemd-234/src/basic/mkdir.c ---- systemd-234-orig/src/basic/mkdir.c 2017-07-17 19:46:03.031674662 -0700 -+++ systemd-234/src/basic/mkdir.c 2017-07-22 21:09:51.065274838 -0700 -@@ -28,6 +28,7 @@ - #include "path-util.h" - #include "stat-util.h" - #include "user-util.h" -+#include "missing.h" - - int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir) { - struct stat st; -diff -ur systemd-234-orig/src/basic/parse-util.c systemd-234/src/basic/parse-util.c ---- systemd-234-orig/src/basic/parse-util.c 2017-07-17 19:46:03.031674662 -0700 -+++ systemd-234/src/basic/parse-util.c 2017-07-21 07:59:05.337491775 -0700 -@@ -30,6 +30,7 @@ - #include "parse-util.h" - #include "process-util.h" - #include "string-util.h" -+#include "missing.h" - - int parse_boolean(const char *v) { - assert(v); diff --git a/nix/nixcrpkgs/pkgs/libusb/builder.sh b/nix/nixcrpkgs/pkgs/libusb/builder.sh deleted file mode 100644 index 211ee465a0..0000000000 --- a/nix/nixcrpkgs/pkgs/libusb/builder.sh +++ /dev/null @@ -1,27 +0,0 @@ -source $setup - -tar -xf $src -mv libusb-* libusb - -mkdir build -cd build - -if [ -n "$libudev" ]; then - export CFLAGS="${CFLAGS:=} -isystem $libudev/include" - export LDFLAGS="${LDFLAGS:=} -L$libudev/lib" -fi - -../libusb/configure \ - --prefix=$out \ - --host=$host \ - --enable-static \ - --disable-shared - -make - -make install - -if [ -n "$libudev" ]; then - ln -s $libudev/lib/pkgconfig/*.pc $out/lib/pkgconfig/ - echo "Requires: libudev" >> $out/lib/pkgconfig/libusb-1.0.pc -fi diff --git a/nix/nixcrpkgs/pkgs/libusb/default.nix b/nix/nixcrpkgs/pkgs/libusb/default.nix deleted file mode 100644 index 3edc45f0b8..0000000000 --- a/nix/nixcrpkgs/pkgs/libusb/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ crossenv, libudev }: - -let - version = "1.0.22"; - - name = "libusbp-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.tar.bz2"; - sha256 = "0mw1a5ss4alg37m6bd4k44v35xwrcwp5qm4s686q1nsgkbavkbkm"; - }; - - lib = crossenv.make_derivation { - inherit version name src; - builder = ./builder.sh; - libudev = if crossenv.os == "linux" then libudev else null; - }; - -in - lib diff --git a/nix/nixcrpkgs/pkgs/libusbp/builder.sh b/nix/nixcrpkgs/pkgs/libusbp/builder.sh deleted file mode 100644 index f117fa5783..0000000000 --- a/nix/nixcrpkgs/pkgs/libusbp/builder.sh +++ /dev/null @@ -1,23 +0,0 @@ -source $setup - -tar -xf $src -mv libusbp-* libusbp - -mkdir build -cd build - -cmake-cross ../libusbp \ - -DCMAKE_INSTALL_PREFIX=$out \ - -DBUILD_SHARED_LIBS=false - -make - -make install - -if [ -d $out/bin ]; then - find $out/bin -type f -exec $host-strip {} + -fi - -if [ -n "$libudev" ]; then - ln -s $libudev/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -fi diff --git a/nix/nixcrpkgs/pkgs/libusbp/default.nix b/nix/nixcrpkgs/pkgs/libusbp/default.nix deleted file mode 100644 index 75c58a2416..0000000000 --- a/nix/nixcrpkgs/pkgs/libusbp/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ crossenv, libudev }: - -let - version = "1.1.0"; - - name = "libusbp-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://github.com/pololu/libusbp/archive/${version}.tar.gz"; - sha256 = "18l34580ci1pq8p3133dnp8nzlz17qw2796xsz1gn0aca6978izc"; - }; - - lib = crossenv.make_derivation { - inherit version name src; - builder = ./builder.sh; - - cross_inputs = - if crossenv.os == "linux" then - [ libudev ] - else - []; - - libudev = if crossenv.os == "linux" then libudev else null; - }; - - examples = crossenv.make_derivation { - name = "${name}-examples"; - inherit src version; - builder = ./examples_builder.sh; - cross_inputs = [ lib ]; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - (if crossenv.os == "linux" then libudev.license_set else {}) // - { "${name}" = license; }; -in - lib // { inherit examples license_set; } diff --git a/nix/nixcrpkgs/pkgs/libusbp/examples_builder.sh b/nix/nixcrpkgs/pkgs/libusbp/examples_builder.sh deleted file mode 100644 index 563608be01..0000000000 --- a/nix/nixcrpkgs/pkgs/libusbp/examples_builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $setup - -tar -xf $src -mv libusbp-* libusbp - -mkdir build -cd build - -FLAGS="-std=gnu++11 $(pkg-config-cross --cflags --libs libusbp-1)" - -$host-g++ ../libusbp/examples/lsusb/*.cpp -o lsusb$exe_suffix $FLAGS -$host-g++ ../libusbp/examples/lsport/*.cpp -o lsport$exe_suffix $FLAGS - -mkdir -p $out/bin -cp * $out/bin/ diff --git a/nix/nixcrpkgs/pkgs/libusbp/license_builder.sh b/nix/nixcrpkgs/pkgs/libusbp/license_builder.sh deleted file mode 100644 index 93111231a0..0000000000 --- a/nix/nixcrpkgs/pkgs/libusbp/license_builder.sh +++ /dev/null @@ -1,20 +0,0 @@ -source $setup - -tar -xf $src -mv libusbp-* libusbp - -license=$(cat libusbp/LICENSE.txt) - -{ - cat > $out <Pololu USB library (libusbp) - -

- The Pololu USB Library (libusbp) is licensed under the following license: -

- -
-$license
-
-EOF -} > $out diff --git a/nix/nixcrpkgs/pkgs/libx11/builder.sh b/nix/nixcrpkgs/pkgs/libx11/builder.sh deleted file mode 100644 index 9f46ef8aca..0000000000 --- a/nix/nixcrpkgs/pkgs/libx11/builder.sh +++ /dev/null @@ -1,24 +0,0 @@ -source $setup - -tar -xf $src -mv libX11-* libx11 - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../libx11/configure --prefix $out $configure_flags - -make - -make install - -# Make static linking work. -sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc - -ln -s x11-xcb.pc $out/lib/pkgconfig/X11-xcb.pc -ln -s x11.pc $out/lib/pkgconfig/X11.pc - -ln -sf $xproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -ln -sf $kbproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -ln -sf $libxcb/lib/pkgconfig/*.pc $out/lib/pkgconfig/ diff --git a/nix/nixcrpkgs/pkgs/libx11/default.nix b/nix/nixcrpkgs/pkgs/libx11/default.nix deleted file mode 100644 index a20b63f757..0000000000 --- a/nix/nixcrpkgs/pkgs/libx11/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ crossenv, xorg-macros, xproto, libxcb, xtrans, - xextproto, inputproto, kbproto }: - -let - version = "1.6.5"; - - name = "libx11-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xorg.freedesktop.org/releases/individual/libX11-${version}.tar.bz2"; - sha256 = "0pa3cfp6h9rl2vxmkph65250gfqyki0ccqyaan6bl9d25gdr0f2d"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - - builder = ./builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--disable-malloc0returnsnull " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ - xorg-macros - xproto - libxcb - xtrans - xextproto - inputproto - kbproto - ]; - - inherit kbproto xproto libxcb; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - xorg-macros.license_set // - xproto.license_set // - libxcb.license_set // - xtrans.license_set // - xextproto.license_set // - inputproto.license_set // - kbproto.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/libx11/license_builder.sh b/nix/nixcrpkgs/pkgs/libx11/license_builder.sh deleted file mode 100644 index 030bafd88b..0000000000 --- a/nix/nixcrpkgs/pkgs/libx11/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv libX11-* libx11 - -license=$(cat libx11/COPYING) - -cat > $out <libx11 - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/libxall/builder.rb b/nix/nixcrpkgs/pkgs/libxall/builder.rb deleted file mode 100644 index f7937666aa..0000000000 --- a/nix/nixcrpkgs/pkgs/libxall/builder.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'pathname' -require 'fileutils' -include FileUtils - -OutDir = Pathname(ENV.fetch('out')) -LibDirs = ENV.fetch('libs').split(' ').map { |s| Pathname(s) } - -def symlink_file(target, dest) - real_target = target.realpath - - if dest.exist? - if !dest.symlink? - raise "Want to link #{dest} (to #{target}) " \ - "but it already exists and is not a symlink." - end - - current_target = dest.readlink - if current_target != real_target - raise "Conflict: #{dest} links to #{current_target} " \ - "but we want to link it to #{real_target}." - end - else - dest.make_symlink(real_target) - end -end - -def recursive_symlink(target, dest) - if target.directory? - dest.mkdir if !dest.directory? - target.children(false).each do |c| - recursive_symlink(target + c, dest + c) - end - else - symlink_file(target, dest) - end -end - -LibDirs.each do |libdir| - recursive_symlink(libdir, OutDir) -end diff --git a/nix/nixcrpkgs/pkgs/libxall/default.nix b/nix/nixcrpkgs/pkgs/libxall/default.nix deleted file mode 100644 index f570802ea7..0000000000 --- a/nix/nixcrpkgs/pkgs/libxall/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -# Amalgamates all of our X libraries into one derivation to make it easier to -# build projects like Qt that expect them all to be installed in one place. - -{ crossenv, libs }: - -let - lib = crossenv.make_derivation { - name = "libxall"; - builder.ruby = ./builder.rb; - inherit libs; - }; - - license_set = builtins.foldl' (x: y: x // y) {} (map (x: x.license_set) libs); -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/libxau/builder.sh b/nix/nixcrpkgs/pkgs/libxau/builder.sh deleted file mode 100644 index b1dd74899f..0000000000 --- a/nix/nixcrpkgs/pkgs/libxau/builder.sh +++ /dev/null @@ -1,16 +0,0 @@ -source $setup - -tar -xf $src -mv libXau-* libxau - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../libxau/configure --prefix=$out $configure_flags - -make - -make install - -ln -s $xproto/lib/pkgconfig/xproto.pc $out/lib/pkgconfig/ diff --git a/nix/nixcrpkgs/pkgs/libxau/default.nix b/nix/nixcrpkgs/pkgs/libxau/default.nix deleted file mode 100644 index fcfabbb0cd..0000000000 --- a/nix/nixcrpkgs/pkgs/libxau/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ crossenv, xorg-macros, xproto }: - -let - version = "1.0.8"; - - name = "libxau-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://www.x.org/archive/individual/lib/libXau-${version}.tar.bz2"; - sha256 = "1wm4pv12f36cwzhldpp7vy3lhm3xdcnp4f184xkxsp7b18r7gm7x"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - - builder = ./builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ xorg-macros xproto ]; - - inherit xproto; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - xorg-macros.license_set // - xproto.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/libxau/license_builder.sh b/nix/nixcrpkgs/pkgs/libxau/license_builder.sh deleted file mode 100644 index fb3825f7a4..0000000000 --- a/nix/nixcrpkgs/pkgs/libxau/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv libXau-* libxau - -license=$(cat libxau/COPYING) - -cat > $out <libxau - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/libxcb/builder.sh b/nix/nixcrpkgs/pkgs/libxcb/builder.sh deleted file mode 100644 index 19162ca987..0000000000 --- a/nix/nixcrpkgs/pkgs/libxcb/builder.sh +++ /dev/null @@ -1,28 +0,0 @@ -source $setup - -tar -xf $src -mv libxcb-* libxcb - -cd libxcb -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done -cd .. - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../libxcb/configure --prefix=$out $configure_flags - -make - -make install - -# Make static linking work. -sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc -sed -i 's/Libs.private/Libs/' $out/lib/pkgconfig/*.pc - -ln -sf $libxau/lib/pkgconfig/*.pc $out/lib/pkgconfig/ - diff --git a/nix/nixcrpkgs/pkgs/libxcb/default.nix b/nix/nixcrpkgs/pkgs/libxcb/default.nix deleted file mode 100644 index d927f15557..0000000000 --- a/nix/nixcrpkgs/pkgs/libxcb/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ crossenv, xcb-proto, libxau }: - -let - version = "1.12"; - - name = "libxcb-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xcb.freedesktop.org/dist/libxcb-${version}.tar.bz2"; - sha256 = "0nvv0la91cf8p5qqlb3r5xnmg1jn2wphn4fb5jfbr6byqsvv3psa"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - - patches = [ ./no-pthread-stubs.patch ]; - - builder = ./builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--enable-static " + - "--disable-shared " + - "--enable-xinput " + - "--enable-xkb"; - - cross_inputs = [ xcb-proto libxau ]; - - inherit libxau; - - native_inputs = [ crossenv.nixpkgs.python2 ]; - }; - - examples = crossenv.make_derivation rec { - name = "libxcb-examples"; - - builder = ./examples_builder.sh; - - cross_inputs = [ lib ]; - - example1 = ./example1.c; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - xcb-proto.license_set // - libxau.license_set // - { "${name}" = license; }; - -in - lib // { inherit examples license_set; } diff --git a/nix/nixcrpkgs/pkgs/libxcb/example1.c b/nix/nixcrpkgs/pkgs/libxcb/example1.c deleted file mode 100644 index 48c2846366..0000000000 --- a/nix/nixcrpkgs/pkgs/libxcb/example1.c +++ /dev/null @@ -1,68 +0,0 @@ -// Source: https://en.wikipedia.org/wiki/XCB#Example - -#include -#include -#include - -int main(void) -{ - xcb_connection_t *c; - xcb_screen_t *s; - xcb_window_t w; - xcb_gcontext_t g; - xcb_generic_event_t *e; - uint32_t mask; - uint32_t values[2]; - int done = 0; - xcb_rectangle_t r = { 20, 20, 60, 60 }; - - /* open connection with the server */ - c = xcb_connect(NULL,NULL); - if (xcb_connection_has_error(c)) { - printf("Cannot open display\n"); - exit(1); - } - /* get the first screen */ - s = xcb_setup_roots_iterator( xcb_get_setup(c) ).data; - - /* create black graphics context */ - g = xcb_generate_id(c); - w = s->root; - mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; - values[0] = s->black_pixel; - values[1] = 0; - xcb_create_gc(c, g, w, mask, values); - - /* create window */ - w = xcb_generate_id(c); - mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; - values[0] = s->white_pixel; - values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS; - xcb_create_window(c, s->root_depth, w, s->root, - 10, 10, 100, 100, 1, - XCB_WINDOW_CLASS_INPUT_OUTPUT, s->root_visual, - mask, values); - - /* map (show) the window */ - xcb_map_window(c, w); - - xcb_flush(c); - - /* event loop */ - while (!done && (e = xcb_wait_for_event(c))) { - switch (e->response_type & ~0x80) { - case XCB_EXPOSE: /* draw or redraw the window */ - xcb_poly_fill_rectangle(c, w, g, 1, &r); - xcb_flush(c); - break; - case XCB_KEY_PRESS: /* exit on key press */ - done = 1; - break; - } - free(e); - } - /* close connection to server */ - xcb_disconnect(c); - - return 0; -} diff --git a/nix/nixcrpkgs/pkgs/libxcb/examples_builder.sh b/nix/nixcrpkgs/pkgs/libxcb/examples_builder.sh deleted file mode 100644 index 1a936f7342..0000000000 --- a/nix/nixcrpkgs/pkgs/libxcb/examples_builder.sh +++ /dev/null @@ -1,10 +0,0 @@ -source $setup - -pkg-config-cross xcb --cflags --libs - -$host-gcc -Wall $example1 \ - $(pkg-config-cross xcb --cflags --libs) \ - -o example1$exe_suffix - -mkdir -p $out/bin -cp example1$exe_suffix $out/bin/ diff --git a/nix/nixcrpkgs/pkgs/libxcb/license_builder.sh b/nix/nixcrpkgs/pkgs/libxcb/license_builder.sh deleted file mode 100644 index 31dd9f821e..0000000000 --- a/nix/nixcrpkgs/pkgs/libxcb/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv libxcb-* libxcb - -license=$(cat libxcb/COPYING) - -cat > $out <libxcb - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/libxcb/no-pthread-stubs.patch b/nix/nixcrpkgs/pkgs/libxcb/no-pthread-stubs.patch deleted file mode 100644 index 53c66b74e5..0000000000 --- a/nix/nixcrpkgs/pkgs/libxcb/no-pthread-stubs.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur libxcb-1.12-orig/configure libxcb-1.12/configure ---- libxcb-1.12-orig/configure 2017-07-29 22:28:37.986987240 -0700 -+++ libxcb-1.12/configure 2017-07-29 22:51:26.410210675 -0700 -@@ -19666,7 +19666,7 @@ - $as_echo "yes" >&6; } - - fi --NEEDED="pthread-stubs xau >= 0.99.2" -+NEEDED="xau >= 0.99.2" - - pkg_failed=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NEEDED" >&5 diff --git a/nix/nixcrpkgs/pkgs/libxext/builder.sh b/nix/nixcrpkgs/pkgs/libxext/builder.sh deleted file mode 100644 index 53bec15525..0000000000 --- a/nix/nixcrpkgs/pkgs/libxext/builder.sh +++ /dev/null @@ -1,19 +0,0 @@ -source $setup - -tar -xf $src -mv libXext-* xext - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../xext/configure --prefix=$out $configure_flags - -make - -make install - -sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc - -ln -sf $xextproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -ln -sf $libx11/lib/pkgconfig/*.pc $out/lib/pkgconfig/ diff --git a/nix/nixcrpkgs/pkgs/libxext/default.nix b/nix/nixcrpkgs/pkgs/libxext/default.nix deleted file mode 100644 index 7cb0295bac..0000000000 --- a/nix/nixcrpkgs/pkgs/libxext/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ crossenv, xproto, libx11, xextproto }: - -let - version = "1.3.3"; - - name = "libxext-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://www.x.org/releases/individual/lib/libXext-${version}.tar.bz2"; - sha256 = "0dbfn5bznnrhqzvkrcmw4c44yvvpwdcsrvzxf4rk27r36b9x865m"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - - builder = ./builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--disable-malloc0returnsnull " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ xproto libx11 xextproto ]; - - inherit xextproto libx11; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - xproto.license_set // - libx11.license_set // - xextproto.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } - diff --git a/nix/nixcrpkgs/pkgs/libxext/license_builder.sh b/nix/nixcrpkgs/pkgs/libxext/license_builder.sh deleted file mode 100644 index 9911963100..0000000000 --- a/nix/nixcrpkgs/pkgs/libxext/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv libXext-* libxext - -license=$(cat libxext/COPYING) - -cat > $out <libxext - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/libxfixes/builder.sh b/nix/nixcrpkgs/pkgs/libxfixes/builder.sh deleted file mode 100644 index 0217ce743e..0000000000 --- a/nix/nixcrpkgs/pkgs/libxfixes/builder.sh +++ /dev/null @@ -1,20 +0,0 @@ -source $setup - -tar -xf $src -mv libXfixes-* xfixes - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../xfixes/configure --prefix=$out $configure_flags - -make - -make install - -sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc - -ln -sf $xproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -ln -sf $fixesproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -ln -sf $libx11/lib/pkgconfig/*.pc $out/lib/pkgconfig/ diff --git a/nix/nixcrpkgs/pkgs/libxfixes/default.nix b/nix/nixcrpkgs/pkgs/libxfixes/default.nix deleted file mode 100644 index fb98228ecb..0000000000 --- a/nix/nixcrpkgs/pkgs/libxfixes/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ crossenv, xproto, xextproto, libx11, fixesproto }: - -let - version = "5.0.3"; - - name = "libxfixes-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://www.x.org/releases/individual/lib/libXfixes-${version}.tar.bz2"; - sha256 = "1miana3y4hwdqdparsccmygqr3ic3hs5jrqfzp70hvi2zwxd676y"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - - builder = ./builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ xproto xextproto libx11 fixesproto ]; - - inherit xproto libx11 fixesproto; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - xproto.license_set // - xextproto.license_set // - libx11.license_set // - fixesproto.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/libxfixes/license_builder.sh b/nix/nixcrpkgs/pkgs/libxfixes/license_builder.sh deleted file mode 100644 index 72bd5a2228..0000000000 --- a/nix/nixcrpkgs/pkgs/libxfixes/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv libXfixes-* libxfixes - -license=$(cat libxfixes/COPYING) - -cat > $out <libxfixes - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/libxi/builder.sh b/nix/nixcrpkgs/pkgs/libxi/builder.sh deleted file mode 100644 index 8c07f9da26..0000000000 --- a/nix/nixcrpkgs/pkgs/libxi/builder.sh +++ /dev/null @@ -1,21 +0,0 @@ -source $setup - -tar -xf $src -mv libXi-* libxi - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../libxi/configure --prefix=$out $configure_flags - -make - -make install - -sed -i 's/Requires.private/Requires/' $out/lib/pkgconfig/*.pc - -ln -sf $inputproto/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -ln -sf $libx11/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -ln -sf $libxext/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -ln -sf $libxfixes/lib/pkgconfig/*.pc $out/lib/pkgconfig/ diff --git a/nix/nixcrpkgs/pkgs/libxi/default.nix b/nix/nixcrpkgs/pkgs/libxi/default.nix deleted file mode 100644 index ab41d41d8d..0000000000 --- a/nix/nixcrpkgs/pkgs/libxi/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ crossenv, xproto, xextproto, inputproto, libx11, libxext, libxfixes }: - -let - version = "1.7.9"; - - name = "libxi-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://www.x.org/releases/individual/lib/libXi-${version}.tar.bz2"; - sha256 = "0idg1wc01hndvaa820fvfs7phvd1ymf0lldmq6386i7rhkzvirn2"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - - builder = ./builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--disable-malloc0returnsnull " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ xproto xextproto inputproto libx11 libxext libxfixes ]; - - inherit inputproto libx11 libxext libxfixes; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - xproto.license_set // - xextproto.license_set // - inputproto.license_set // - libx11.license_set // - libxext.license_set // - libxfixes.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/libxi/license_builder.sh b/nix/nixcrpkgs/pkgs/libxi/license_builder.sh deleted file mode 100644 index 966f930964..0000000000 --- a/nix/nixcrpkgs/pkgs/libxi/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv libXi-* libxi - -license=$(cat libxi/COPYING) - -cat > $out <libxi - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/lmdb/builder.sh b/nix/nixcrpkgs/pkgs/lmdb/builder.sh deleted file mode 100644 index a8d2909d89..0000000000 --- a/nix/nixcrpkgs/pkgs/lmdb/builder.sh +++ /dev/null @@ -1,16 +0,0 @@ -source $setup - -cp -r $src ./src -chmod -R u+w ./src -cd src/libraries/liblmdb - -sed -i 's/liblmdb.a liblmdb..SOEXT.$/liblmdb.a/' Makefile -sed -i "s/gcc/$host-gcc/" Makefile -sed -i "s/ar/$host-ar/" Makefile -sed -i 's/^CC.*/CC = '"$host-gcc/" Makefile - -cat Makefile - -make CFLAGS+="-fPIC" - -make DESTDIR="$out" prefix=/ install diff --git a/nix/nixcrpkgs/pkgs/lmdb/default.nix b/nix/nixcrpkgs/pkgs/lmdb/default.nix deleted file mode 100644 index 140fc16094..0000000000 --- a/nix/nixcrpkgs/pkgs/lmdb/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "lmdb-${version}"; - version = "0.9.23"; - builder = ./builder.sh; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "LMDB"; - repo = "lmdb"; - rev = "LMDB_${version}"; - sha256 = "0ag7l5180ajvm73y59m7sn3p52xm8m972d08cshxhpwgwa4v35k6"; - }; -} diff --git a/nix/nixcrpkgs/pkgs/ncurses/builder.sh b/nix/nixcrpkgs/pkgs/ncurses/builder.sh deleted file mode 100644 index d7740f353d..0000000000 --- a/nix/nixcrpkgs/pkgs/ncurses/builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -cd * - -./configure --host=$host --prefix=$out $configureFlags - -make - -make install.{libs,includes,data} - -# TODO Why do I need to do this? -mkdir -p $out/lib/pkgconfig -cp misc/*.pc $out/lib/pkgconfig diff --git a/nix/nixcrpkgs/pkgs/ncurses/default.nix b/nix/nixcrpkgs/pkgs/ncurses/default.nix deleted file mode 100644 index e602b2ec65..0000000000 --- a/nix/nixcrpkgs/pkgs/ncurses/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "ncurses-${version}"; - version = "6.1-20181027"; - builder = ./builder.sh; - - # Needs to be the same version. - native_inputs = [ crossenv.nixpkgs.ncurses ]; - - configureFlags = [ - "--without-debug" - "--enable-pc-files" - "--enable-symlinks" - # "--with-manpage-format=normal" - "--without-cxx" - # "--enable-widec" - ]; - - src = crossenv.nixpkgs.fetchurl { - urls = [ - "https://invisible-mirror.net/archives/ncurses/current/ncurses-${version}.tgz" - "ftp://ftp.invisible-island.net/ncurses/current/ncurses-${version}.tgz" - ]; - sha256 = "1xn6wpi22jc61158w4ifq6s1fvilhmsy1in2srn3plk8pm0d4902"; - }; -} diff --git a/nix/nixcrpkgs/pkgs/openocd/builder.sh b/nix/nixcrpkgs/pkgs/openocd/builder.sh deleted file mode 100644 index c1c388d88d..0000000000 --- a/nix/nixcrpkgs/pkgs/openocd/builder.sh +++ /dev/null @@ -1,24 +0,0 @@ -source $setup - -cp -r $src openocd -chmod -R u+w openocd - -cd openocd -SKIP_SUBMODULE=1 ./bootstrap -cd .. - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross ../openocd/configure \ - --prefix=$out \ - --host=$host \ - --disable-dependency-tracking \ - --enable-static \ - --disable-shared - -make - -make install - -$host-strip $out/bin/openocd diff --git a/nix/nixcrpkgs/pkgs/openocd/default.nix b/nix/nixcrpkgs/pkgs/openocd/default.nix deleted file mode 100644 index 756ce99897..0000000000 --- a/nix/nixcrpkgs/pkgs/openocd/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ crossenv, libusb }: - -let - version = "2018-08-16"; - - name = "openocd-${version}"; - - nixpkgs = crossenv.nixpkgs; - - src = nixpkgs.fetchgit { - url = "git://repo.or.cz/openocd"; # official mirror - rev = "b2d259f67cc3ee4b689e704228d97943bae94064"; - sha256 = "0c5zpjplwp0ivl4mpiix628j0iad9gkmg9f7lidgqjr5a80cr6hg"; - deepClone = true; - }; - - drv = crossenv.make_derivation { - inherit version name src; - builder = ./builder.sh; - - native_inputs = [ - nixpkgs.autoconf - nixpkgs.automake - nixpkgs.libtool - nixpkgs.m4 - ]; - - ACLOCAL_PATH = - "${nixpkgs.libtool}/share/aclocal:" + - "${crossenv.native.pkgconf}/share/aclocal"; - - # Avoid a name conflict: get_home_dir is also defined in libudev. - CFLAGS = "-Dget_home_dir=openocd_get_home_dir"; - - cross_inputs = [ libusb ]; - }; - -in - drv diff --git a/nix/nixcrpkgs/pkgs/openssl/builder.sh b/nix/nixcrpkgs/pkgs/openssl/builder.sh deleted file mode 100644 index e47e43ab11..0000000000 --- a/nix/nixcrpkgs/pkgs/openssl/builder.sh +++ /dev/null @@ -1,46 +0,0 @@ -source $setup - -tar -xf $src - -mkdir build -cd build - -err () { echo ERR "$@" >&2; } - -case $host in - i686-linux-musleabi) - confighost=linux-x86;; - x86_64-linux-musleabi) - confighost=linux-x86_64;; - x86_64-apple-darwin*) - confighost=darwin64-x86_64-cc;; - *) - err openssl builder.sh needs to excplicitly translate - err "'host=$host'" to something openssl understands. - confighost=$host;; -esac - -# TODO The `no-async` option seems weird, but -# https://github.com/openssl/openssl/issues/1607 - -# TODO I stole the no-dso option from the here[1], but is it -# needed? I seems to be related to shared libraries, which we aren't using -# anyways, but I don't like not understanding. -# -# [1]: https://github.com/rust-embedded/cross/blob/master/docker/openssl.sh - -# TODO Why `-fPIC`? I stole it from [2] -# -# [2]: https://github.com/rust-embedded/cross/pull/218/files - -../openssl-$version/Configure \ - --prefix=$out \ - --cross-compile-prefix=$host- \ - no-shared \ - no-dso \ - no-async \ - $confighost \ - -fPIC - -make -make install diff --git a/nix/nixcrpkgs/pkgs/openssl/default.nix b/nix/nixcrpkgs/pkgs/openssl/default.nix deleted file mode 100644 index de9b876f90..0000000000 --- a/nix/nixcrpkgs/pkgs/openssl/default.nix +++ /dev/null @@ -1,83 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "openssl-${version}"; - version = "1.1.1"; - - native_inputs = [ crossenv.nixpkgs.perl ]; - - src = crossenv.nixpkgs.fetchurl { - url = "https://www.openssl.org/source/${name}.tar.gz"; - sha256 = "0gbab2fjgms1kx5xjvqx8bxhr98k4r8l2fa8vw7kvh491xd8fdi8"; - }; - - builder = ./builder.sh; -} - -# let -# -# coreutils = crossenv.nixpkgs.coreutils; -# -# # with stdenv.lib; -# -# in -# -# { -# -# patches = [ ./nix-ssl-cert-file.patch ]; -# -# native_inputs = [ crossenv.nixpkgs.perl ]; -# -# postPatch = '' -# patchShebangs Configure -# '' + optionalString (versionAtLeast version "1.1.1") '' -# substituteInPlace config --replace '/usr/bin/env' '${coreutils}/bin/env' -# '' + optionalString (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isMusl) '' -# substituteInPlace crypto/async/arch/async_posix.h \ -# --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \ -# '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0' -# ''; -# -# configureScript = { -# "x86_64-darwin" = "./Configure darwin64-x86_64-cc"; -# "x86_64-solaris" = "./Configure solaris64-x86_64-gcc"; -# "armv6l-linux" = "./Configure linux-armv4 -march=armv6"; -# "armv7l-linux" = "./Configure linux-armv4 -march=armv7-a"; -# }.${stdenv.hostPlatform.system} or ( -# if stdenv.hostPlatform == stdenv.buildPlatform -# then "./config" -# else if stdenv.hostPlatform.isMinGW -# then "./Configure mingw${optionalString -# (stdenv.hostPlatform.parsed.cpu.bits != 32) -# (toString stdenv.hostPlatform.parsed.cpu.bits)}" -# else if stdenv.hostPlatform.isLinux -# then "./Configure linux-generic${toString stdenv.hostPlatform.parsed.cpu.bits}" -# else if stdenv.hostPlatform.isiOS -# then "./Configure ios${toString stdenv.hostPlatform.parsed.cpu.bits}-cross" -# else -# throw "Not sure what configuration to use for ${stdenv.hostPlatform.config}" -# ); -# -# configureFlags = [ -# "shared" # "shared" builds both shared and static libraries -# "--libdir=lib" -# "--openssldir=etc/ssl" -# ] ++ stdenv.lib.optionals withCryptodev [ -# "-DHAVE_CRYPTODEV" -# "-DUSE_CRYPTODEV_DIGESTS" -# ] -# ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isAarch64) "no-afalgeng"; -# -# postInstall = '' -# mkdir -p $bin -# mv $out/bin $bin/ -# -# mkdir $dev -# mv $out/include $dev/ -# -# # remove dependency on Perl at runtime -# rm -r $out/etc/ssl/misc -# -# rmdir $out/etc/ssl/{certs,private} -# ''; -# }; diff --git a/nix/nixcrpkgs/pkgs/p-load/builder.sh b/nix/nixcrpkgs/pkgs/p-load/builder.sh deleted file mode 100644 index 7ebc2e6ace..0000000000 --- a/nix/nixcrpkgs/pkgs/p-load/builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv p-load-* p-load - -mkdir build -cd build - -cmake-cross ../p-load \ - -DCMAKE_INSTALL_PREFIX=$out - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/p-load/default.nix b/nix/nixcrpkgs/pkgs/p-load/default.nix deleted file mode 100644 index 6ce88528bf..0000000000 --- a/nix/nixcrpkgs/pkgs/p-load/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ crossenv, libusbp }: - -crossenv.make_derivation rec { - name = "p-load-${version}"; - - version = "2041b02"; # 2.1.0ish - - src = crossenv.nixpkgs.fetchurl { - url = "https://github.com/pololu/p-load/archive/${version}.tar.gz"; - sha256 = "07xn0k96pkvirsh45zn9976lwliiqkfx76vy1yrbx6kp55ssp2zp"; - }; - - builder = ./builder.sh; - - cross_inputs = [ libusbp ]; -} diff --git a/nix/nixcrpkgs/pkgs/pavr2/builder.sh b/nix/nixcrpkgs/pkgs/pavr2/builder.sh deleted file mode 100644 index b516b69263..0000000000 --- a/nix/nixcrpkgs/pkgs/pavr2/builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv pololu-usb-avr-programmer-v2-* pavr2 - -mkdir build -cd build - -cmake-cross ../pavr2 \ - -DCMAKE_INSTALL_PREFIX=$out - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/pavr2/default.nix b/nix/nixcrpkgs/pkgs/pavr2/default.nix deleted file mode 100644 index 379e61b51d..0000000000 --- a/nix/nixcrpkgs/pkgs/pavr2/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ crossenv, qt, libusbp }: - -crossenv.make_derivation rec { - name = "pavr2-${version}"; - - version = "a113a3b"; # 1.0.2ish - - src = crossenv.nixpkgs.fetchurl { - url = "https://github.com/pololu/pololu-usb-avr-programmer-v2/archive/${version}.tar.gz"; - sha256 = "1mg467jx7mpcn01vh8rq80w7p8mbj7l69dmpyni0nik44ggsj7ij"; - }; - - builder = ./builder.sh; - - cross_inputs = [ libusbp qt ]; -} diff --git a/nix/nixcrpkgs/pkgs/pdcurses/builder.sh b/nix/nixcrpkgs/pkgs/pdcurses/builder.sh deleted file mode 100644 index e9dc462058..0000000000 --- a/nix/nixcrpkgs/pkgs/pdcurses/builder.sh +++ /dev/null @@ -1,37 +0,0 @@ -source $setup - -tar -xf $src -mv PDCurses-* pdcurses - -mkdir build -cd build - -source_files=../pdcurses/pdcurses/*.c - -if [ "$os" == "windows" ]; then - os_files=../pdcurses/win32/*.c -fi - -if [ "$os" == "linux" ]; then - os_files= -fi - -source_files="$source_files $os_files" - -for s in $source_files; do - echo "compiling $s" - $host-gcc -g -O2 -I../pdcurses \ - -DPDC_WIDE -DPDC_FORCE_UTF8 -c "$s" -o "$(basename $s).o" -done - -$host-ar r libpdcurses.a *.o -$host-ranlib libpdcurses.a - -mkdir -p $out/{lib,include} -cp libpdcurses.a $out/lib/libpdcurses.a - -# Make libcurses.a so programs like GDB can find pdcurses. -ln -s $out/lib/libpdcurses.a $out/lib/libcurses.a - -cd ../pdcurses -cp curses.h panel.h term.h $out/include/ diff --git a/nix/nixcrpkgs/pkgs/pdcurses/default.nix b/nix/nixcrpkgs/pkgs/pdcurses/default.nix deleted file mode 100644 index 0a47f6564d..0000000000 --- a/nix/nixcrpkgs/pkgs/pdcurses/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -# Note: This only seems to work on Windows. - -{ crossenv }: - -let - - pdcurses = import ./lib.nix { - inherit crossenv; - }; - - examples = import ./examples.nix { - inherit crossenv pdcurses; - }; - -in - pdcurses // { inherit examples; } diff --git a/nix/nixcrpkgs/pkgs/pdcurses/demos_builder.sh b/nix/nixcrpkgs/pkgs/pdcurses/demos_builder.sh deleted file mode 100644 index eea6a67379..0000000000 --- a/nix/nixcrpkgs/pkgs/pdcurses/demos_builder.sh +++ /dev/null @@ -1,25 +0,0 @@ -source $setup - -tar -xf $src -mv PDCurses-$version/demos . -rm -r PDCurses-$version - -mkdir build -cd build - -CFLAGS="-g -O2 -I$pdcurses/include -DPDC_WIDE" - -$host-gcc $CFLAGS -c ../demos/tui.c -o tui.o -$host-ar r tui.a tui.o - -demos="firework newdemo ptest rain testcurs worm xmas tuidemo" - -for name in $demos; do - src=../demos/$name.c - echo "compiling $name" - $host-gcc $CFLAGS -L"$pdcurses/lib" \ - "$src" tui.a -lpdcurses -o "$name.exe" -done - -mkdir -p $out/bin -mv *.exe $out/bin/ diff --git a/nix/nixcrpkgs/pkgs/pdcurses/examples.nix b/nix/nixcrpkgs/pkgs/pdcurses/examples.nix deleted file mode 100644 index 8b3dbee385..0000000000 --- a/nix/nixcrpkgs/pkgs/pdcurses/examples.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ crossenv, pdcurses }: - -crossenv.make_derivation rec { - name = "pdcurses_demos-${version}"; - - inherit pdcurses; - inherit (pdcurses) src version; - - builder = ./demos_builder.sh; -} - diff --git a/nix/nixcrpkgs/pkgs/pdcurses/lib.nix b/nix/nixcrpkgs/pkgs/pdcurses/lib.nix deleted file mode 100644 index ef4293502d..0000000000 --- a/nix/nixcrpkgs/pkgs/pdcurses/lib.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "pdcurses-${version}"; - - version = "3.4"; - - src = crossenv.nixpkgs.fetchurl { - # Sourceforge went down. The original URL was: - # url = "mirror://sourceforge/pdcurses/PDCurses-${version}.tar.gz"; - url = "https://files.tmphax.com/repo1/pdcurses-${version}.tar.gz"; - sha256 = "0jz6l8552fnf1j542yhzifgknrdzrisxg158ks0l87g777a8zba6"; - }; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/qt/absolute-paths.patch b/nix/nixcrpkgs/pkgs/qt/absolute-paths.patch deleted file mode 100644 index 93ab1e1fc2..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/absolute-paths.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -ur qtbase-opensource-src-5.9.2-orig/configure qtbase-opensource-src-5.9.2/configure ---- qtbase-opensource-src-5.9.2-orig/configure 2017-10-26 08:10:12.932646805 -0700 -+++ qtbase-opensource-src-5.9.2/configure 2017-11-01 08:48:44.973917507 -0700 -@@ -36,9 +36,9 @@ - relconf=`basename $0` - # the directory of this script is the "source tree" - relpath=`dirname $0` --relpath=`(cd "$relpath"; /bin/pwd)` -+relpath=`(cd "$relpath"; pwd)` - # the current directory is the "build tree" or "object tree" --outpath=`/bin/pwd` -+outpath=`pwd` - - WHICH="which" - -@@ -232,7 +232,7 @@ - - sdk=$(getSingleQMakeVariable "QMAKE_MAC_SDK" "$1") - if [ -z "$sdk" ]; then echo "QMAKE_MAC_SDK must be set when building on Mac" >&2; exit 1; fi -- sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null) -+ sysroot=$(xcrun --sdk $sdk --show-sdk-path 2>/dev/null) - if [ -z "$sysroot" ]; then echo "Failed to resolve SDK path for '$sdk'" >&2; exit 1; fi - - case "$sdk" in -@@ -267,7 +267,7 @@ - # Prefix tool with toolchain path - var=$(echo "$line" | cut -d '=' -f 1) - val=$(echo "$line" | cut -d '=' -f 2-) -- sdk_val=$(/usr/bin/xcrun -sdk $sdk -find $(echo $val | cut -d ' ' -f 1)) -+ sdk_val=$(xcrun -sdk $sdk -find $(echo $val | cut -d ' ' -f 1)) - val=$(echo $sdk_val $(echo $val | cut -s -d ' ' -f 2-)) - echo "$var=$val" - ;; -@@ -305,9 +305,6 @@ - UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown - - BUILD_ON_MAC=no --if [ -d /System/Library/Frameworks/Carbon.framework ]; then -- BUILD_ON_MAC=yes --fi - if [ "$OSTYPE" = "msys" ]; then - relpath=`(cd "$relpath"; pwd -W)` - outpath=`pwd -W` -@@ -318,7 +315,7 @@ - #------------------------------------------------------------------------------- - - if [ "$BUILD_ON_MAC" = "yes" ]; then -- if ! /usr/bin/xcode-select --print-path >/dev/null 2>&1; then -+ if ! xcode-select --print-path >/dev/null 2>&1; then - echo >&2 - echo " No Xcode selected. Please install Xcode via the App Store, " >&2 - echo " or the command line developer tools via xcode-select --install, " >&2 -@@ -329,8 +326,8 @@ - fi - - # In the else case we are probably using a Command Line Tools installation -- if /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1; then -- if ! /usr/bin/xcrun xcodebuild -license check 2>/dev/null; then -+ if xcrun -find xcodebuild >/dev/null 2>&1; then -+ if ! xcrun xcodebuild -license check 2>/dev/null; then - echo >&2 - echo " Xcode setup not complete. You need to confirm the license" >&2 - echo " agreement by running 'sudo xcrun xcodebuild -license accept'." >&2 diff --git a/nix/nixcrpkgs/pkgs/qt/builder.sh b/nix/nixcrpkgs/pkgs/qt/builder.sh deleted file mode 100644 index 1668ce2800..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/builder.sh +++ /dev/null @@ -1,23 +0,0 @@ -source $setup - -mkdir -p $out -pushd $out -tar -xf $src -mv qtbase-opensource-src-* src -cd src -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done -popd - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -$out/src/configure -prefix $out $configure_flags - -make - -make install - diff --git a/nix/nixcrpkgs/pkgs/qt/core_macros.cmake b/nix/nixcrpkgs/pkgs/qt/core_macros.cmake deleted file mode 100644 index f3ef672fda..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/core_macros.cmake +++ /dev/null @@ -1,106 +0,0 @@ -# These macros come from src/corelib/Qt5CoreMacros.cmake originally. - -#============================================================================= -# Copyright 2005-2011 Kitware, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the name of Kitware, Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= - -macro(QT5_MAKE_OUTPUT_FILE infile prefix ext outfile ) - string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength) - string(LENGTH ${infile} _infileLength) - set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR}) - if(_infileLength GREATER _binlength) - string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile) - if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") - file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile}) - else() - file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) - endif() - else() - file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) - endif() - if(WIN32 AND rel MATCHES "^([a-zA-Z]):(.*)$") # absolute path - set(rel "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}") - endif() - set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") - string(REPLACE ".." "__" _outfile ${_outfile}) - get_filename_component(outpath ${_outfile} PATH) - get_filename_component(_outfile ${_outfile} NAME_WE) - file(MAKE_DIRECTORY ${outpath}) - set(${outfile} ${outpath}/${prefix}${_outfile}.${ext}) -endmacro() - -function(_QT5_PARSE_QRC_FILE infile _out_depends _rc_depends) - get_filename_component(rc_path ${infile} PATH) - if(EXISTS "${infile}") - file(READ "${infile}" RC_FILE_CONTENTS) - string(REGEX MATCHALL "]*>" "" RC_FILE "${RC_FILE}") - if(NOT IS_ABSOLUTE "${RC_FILE}") - set(RC_FILE "${rc_path}/${RC_FILE}") - endif() - set(RC_DEPENDS ${RC_DEPENDS} "${RC_FILE}") - endforeach() - qt5_make_output_file("${infile}" "" "qrc.depends" out_depends) - configure_file("${infile}" "${out_depends}" COPYONLY) - else() - set(out_depends) - endif() - set(${_out_depends} ${out_depends} PARENT_SCOPE) - set(${_rc_depends} ${RC_DEPENDS} PARENT_SCOPE) -endfunction() - -function(QT5_ADD_RESOURCES outfiles ) - set(options) - set(oneValueArgs) - set(multiValueArgs OPTIONS) - cmake_parse_arguments(_RCC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(rcc_files ${_RCC_UNPARSED_ARGUMENTS}) - set(rcc_options ${_RCC_OPTIONS}) - - if("${rcc_options}" MATCHES "-binary") - message(WARNING "Use qt5_add_binary_resources for binary option") - endif() - - foreach(it ${rcc_files}) - get_filename_component(outfilename ${it} NAME_WE) - get_filename_component(infile ${it} ABSOLUTE) - set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp) - _QT5_PARSE_QRC_FILE(${infile} _out_depends _rc_depends) - add_custom_command(OUTPUT ${outfile} - COMMAND ${Qt5Core_RCC_EXECUTABLE} - ARGS ${rcc_options} --name ${outfilename} --output ${outfile} ${infile} - MAIN_DEPENDENCY ${infile} - DEPENDS ${_rc_depends} "${out_depends}" VERBATIM) - list(APPEND ${outfiles} ${outfile}) - endforeach() - set(${outfiles} ${${outfiles}} PARENT_SCOPE) -endfunction() diff --git a/nix/nixcrpkgs/pkgs/qt/dbus-null-pointer.patch b/nix/nixcrpkgs/pkgs/qt/dbus-null-pointer.patch deleted file mode 100644 index 8e8543c62c..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/dbus-null-pointer.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur qtbase-opensource-src-5.9.6-orig/src/platformsupport/linuxaccessibility/dbusconnection.cpp qtbase-opensource-src-5.9.6/src/platformsupport/linuxaccessibility/dbusconnection.cpp ---- qtbase-opensource-src-5.9.6-orig/src/platformsupport/linuxaccessibility/dbusconnection.cpp 2018-06-19 12:42:00.533895696 -0700 -+++ qtbase-opensource-src-5.9.6/src/platformsupport/linuxaccessibility/dbusconnection.cpp 2018-06-19 12:45:03.308744607 -0700 -@@ -75,7 +75,7 @@ - connect(dbusWatcher, SIGNAL(serviceRegistered(QString)), this, SLOT(serviceRegistered())); - - // If it is registered already, setup a11y right away -- if (c.interface()->isServiceRegistered(A11Y_SERVICE)) -+ if (c.interface() && c.interface()->isServiceRegistered(A11Y_SERVICE)) - serviceRegistered(); - - // In addition try if there is an xatom exposing the bus address, this allows applications run as root to work diff --git a/nix/nixcrpkgs/pkgs/qt/default.nix b/nix/nixcrpkgs/pkgs/qt/default.nix deleted file mode 100644 index 5a9f4d6752..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/default.nix +++ /dev/null @@ -1,165 +0,0 @@ -# TODO: look into why were compiling with this impure option on Linux: -# -DDFLT_XKB_CONFIG_ROOT=\"/usr/share/X11/xkb\" - -# TODO: patch qt to not use /bin/pwd, test building it in a sandbox - -{ crossenv, libudev, libxall, at-spi2-headers, dejavu-fonts }: - -let - version = "5.9.6"; - - name = "qtbase-${version}"; - - platform = - let - os_code = - if crossenv.os == "windows" then "win32" - else if crossenv.os == "macos" then "macx" - else if crossenv.os == "linux" then "devices/linux-generic" - else crossenv.os; - compiler_code = - if crossenv.compiler == "gcc" then "g++" - else crossenv.compiler; - in "${os_code}-${compiler_code}"; - - base_src = crossenv.nixpkgs.fetchurl { - url = "https://download.qt.io/official_releases/qt/5.9/${version}/submodules/qtbase-opensource-src-${version}.tar.xz"; - sha256 = "0vz3rgx7bk50jzy78lxv5pff2l8xqmqs9iiz7gc9n6cb4v5j1mpf"; - }; - - base_raw = crossenv.make_derivation { - name = "qtbase-raw-${version}"; - inherit version; - src = base_src; - builder = ./builder.sh; - - patches = [ - # Purity issue: Don't look at the build system using absolute paths. - ./absolute-paths.patch - - # macOS configuration: Don't run tools from /usr/bin, use the right - # compiler, and don't pass redundant options to it (-arch, -isysroot, - # -mmacosx-version-min). - ./macos-config.patch - - # libX11.a depends on libxcb.a. This makes tests.xlib in - # src/gui/configure.json pass, enabling lots of X functionality in Qt. - ./find-x-libs.patch - - # Fix the build error caused by https://bugreports.qt.io/browse/QTBUG-63637 - ./win32-link-object-max.patch - - # The .pc files have incorrect library names without this (e.g. Qt5Cored) - ./pc-debug-name.patch - - # uxtheme.h test is broken, always returns false, and results in QtWidgets - # apps looking bad on Windows. https://stackoverflow.com/q/44784414/28128 - ./dont-test-uxtheme.patch - - # When cross-compiling, Qt uses some heuristics about whether to trust the - # pkg-config executable supplied by the PKG_CONFIG environment variable. - # These heuristics are wrong for us, so disable them, making qt use - # pkg-config-cross. - ./pkg-config-cross.patch - - # When the DBus session bus is not available, Qt tries to dereference a - # null pointer, so Linux applications can't start up. - ./dbus-null-pointer.patch - - # Look for fonts in the same directory as the application by default if - # the QT_QPA_FONTDIR environment variable is not present. Without this - # patch, Qt tries to look for a font directory in the nix store that does - # not exists, and prints warnings. - # You must ship a .ttf, .ttc, .pfa, .pfb, or .otf font file - # with your application (e.g. https://dejavu-fonts.github.io/ ). - # That list of extensions comes from qbasicfontdatabase.cpp. - ./font-dir.patch - ]; - - configure_flags = - "-opensource -confirm-license " + - "-xplatform ${platform} " + - "-device-option CROSS_COMPILE=${crossenv.host}- " + - "-release " + # change to -debug if you want debugging symbols - "-static " + - "-pkg-config " + - "-nomake examples " + - "-no-icu " + - "-no-fontconfig " + - "-no-reduce-relocations " + - ( if crossenv.os == "windows" then - "-opengl desktop" - else if crossenv.os == "linux" then - "-qpa xcb " + - "-system-xcb " + - "-no-opengl " + - "-device-option QMAKE_INCDIR_X11=${libxall}/include " + - "-device-option QMAKE_LIBDIR_X11=${libxall}/lib" - else if crossenv.os == "macos" then - "-device-option QMAKE_MAC_SDK.macosx.--show-sdk-path=" + - "${crossenv.sdk} " + - "-device-option QMAKE_MAC_SDK.macosx.--show-sdk-platform-path=" + - "${crossenv.sdk}/does-not-exist " + - "-device-option QMAKE_MAC_SDK.macosx.--show-sdk-version=" + - "${crossenv.macos_version_min} " + - "-device-option QMAKE_XCODE_VERSION=7.0" - else "" ); - - cross_inputs = - if crossenv.os == "linux" then [ - libudev # not sure if this helps, but Qt does look for it - libxall - at-spi2-headers # for accessibility - ] - else []; - }; - - # This wrapper aims to make Qt easier to use by generating CMake package files - # for it. The existing support for CMake in Qt does not handle static - # linking; other projects maintian large, messy patches to fix it, but we - # prefer to generate the CMake files in a clean way from scratch. - base = crossenv.make_derivation { - inherit version name; - os = crossenv.os; - qtbase = base_raw; - cross_inputs = base_raw.cross_inputs; - builder.ruby = ./wrapper_builder.rb; - core_macros = ./core_macros.cmake; - }; - - examples = crossenv.make_derivation { - name = "qtbase-examples-${version}"; - inherit version; - os = crossenv.os; - qtbase = base; - cross_inputs = [ base ]; - dejavu = dejavu-fonts; - builder = ./examples_builder.sh; - }; - - license_fragment = crossenv.native.make_derivation { - name = "qtbase-${version}-license-fragment"; - inherit version; - src = base_src; - builder = ./license_builder.sh; - }; - - license_set = - ( - if crossenv.os == "linux" then - libudev.license_set // - libxall.license_set // - at-spi2-headers.license_set - else - {} - ) // - { "${name}" = license_fragment; }; -in - base // { - recurseForDerivations = true; - inherit base_src; - inherit base_raw; - inherit base; - inherit examples; - inherit license_set; - } diff --git a/nix/nixcrpkgs/pkgs/qt/dont-test-uxtheme.patch b/nix/nixcrpkgs/pkgs/qt/dont-test-uxtheme.patch deleted file mode 100644 index c416201388..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/dont-test-uxtheme.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur qtbase-opensource-src-5.9.2-orig/src/widgets/configure.json qtbase-opensource-src-5.9.2/src/widgets/configure.json ---- qtbase-opensource-src-5.9.2-orig/src/widgets/configure.json 2017-10-25 13:52:49.173421900 -0700 -+++ qtbase-opensource-src-5.9.2/src/widgets/configure.json 2017-10-25 13:53:42.891341214 -0700 -@@ -28,11 +28,6 @@ - }, - - "tests": { -- "uxtheme": { -- "label": "uxtheme.h", -- "type": "files", -- "files": [ "uxtheme.h" ] -- } - }, - - "features": { -@@ -57,7 +52,7 @@ - }, - "style-windowsxp": { - "label": "WindowsXP", -- "condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme", -+ "condition": "features.style-windows && config.win32 && !config.winrt", - "output": [ "privateFeature", "styles" ] - }, - "style-windowsvista": { diff --git a/nix/nixcrpkgs/pkgs/qt/examples_builder.sh b/nix/nixcrpkgs/pkgs/qt/examples_builder.sh deleted file mode 100644 index d5d56e11c0..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/examples_builder.sh +++ /dev/null @@ -1,88 +0,0 @@ -source $setup - -examples=$qtbase/src/examples - -mkdir build -cd build -mkdir bin moc obj - -cat > obj/plugins.cpp < -#ifdef _WIN32 -Q_IMPORT_PLUGIN (QWindowsIntegrationPlugin); -#endif -#ifdef __linux__ -Q_IMPORT_PLUGIN (QLinuxFbIntegrationPlugin); -Q_IMPORT_PLUGIN (QXcbIntegrationPlugin); -#endif -EOF - -CFLAGS="-std=gnu++11" - -echo "compiling reference to plugins" -$host-g++ $CFLAGS \ - $(pkg-config-cross --cflags Qt5Core) \ - -c obj/plugins.cpp \ - -o obj/plugins.o - -CFLAGS="$CFLAGS -g -I. $(pkg-config-cross --cflags Qt5Widgets)" -LIBS="$(pkg-config-cross --libs Qt5Widgets)" -LDFLAGS="" - -if [ $os = "windows" ]; then - CFLAGS="-mwindows $CFLAGS" -fi - -echo "compiling dynamiclayouts" -$qtbase/bin/moc $examples/widgets/layouts/dynamiclayouts/dialog.h > moc/dynamiclayouts.cpp -$host-g++ $CFLAGS $LDFLAGS \ - $examples/widgets/layouts/dynamiclayouts/dialog.cpp \ - $examples/widgets/layouts/dynamiclayouts/main.cpp \ - moc/dynamiclayouts.cpp \ - obj/plugins.o \ - $LIBS -o bin/dynamiclayouts$exe_suffix - -echo "compiling rasterwindow" -$qtbase/bin/moc $examples/gui/rasterwindow/rasterwindow.h > moc/rasterwindow.cpp -$host-g++ $CFLAGS $LDFLAGS \ - $examples/gui/rasterwindow/rasterwindow.cpp \ - $examples/gui/rasterwindow/main.cpp \ - moc/rasterwindow.cpp \ - obj/plugins.o \ - $LIBS -o bin/rasterwindow$exe_suffix - -echo "compiling analogclock" -$host-g++ $CFLAGS $LDFLAGS \ - -I$examples/gui/rasterwindow/ \ - $examples/gui/analogclock/main.cpp \ - $examples/gui/rasterwindow/rasterwindow.cpp \ - moc/rasterwindow.cpp \ - obj/plugins.o \ - $LIBS -o bin/analogclock$exe_suffix - -# We haven't gotten OpenGL support to work on Linux yet (TODO) -if [ $os != "linux" ]; then - echo "compiling openglwindow" - $qtbase/bin/moc $examples/gui/openglwindow/openglwindow.h > moc/openglwindow.cpp - $host-g++ $CFLAGS $LDFLAGS \ - $examples/gui/openglwindow/main.cpp \ - $examples/gui/openglwindow/openglwindow.cpp \ - moc/openglwindow.cpp \ - obj/plugins.o \ - $LIBS -o bin/openglwindow$exe_suffix -fi - -# TODO: try to compile some stuff with $qtbase/bin/qmake too, make sure that works - -mkdir -p $out/bin - -for prog in analogclock dynamiclayouts openglwindow rasterwindow; do - if [ -f bin/$prog ]; then - $host-strip bin/$prog - cp bin/$prog $out/bin/ - fi -done - -if [ $os = "linux" ]; then - cp $dejavu/ttf/DejaVuSans.ttf $out/bin/ -fi diff --git a/nix/nixcrpkgs/pkgs/qt/find-x-libs.patch b/nix/nixcrpkgs/pkgs/qt/find-x-libs.patch deleted file mode 100644 index 73bd770050..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/find-x-libs.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/common/linux.conf qtbase-opensource-src-5.9.2/mkspecs/common/linux.conf ---- qtbase-opensource-src-5.9.2-orig/mkspecs/common/linux.conf 2017-10-26 08:10:12.922646692 -0700 -+++ qtbase-opensource-src-5.9.2/mkspecs/common/linux.conf 2017-10-26 21:44:37.695088447 -0700 -@@ -28,7 +28,7 @@ - - QMAKE_LIBS = - QMAKE_LIBS_DYNLOAD = -ldl --QMAKE_LIBS_X11 = -lXext -lX11 -lm -+QMAKE_LIBS_X11 = -lXext -lX11 -lxcb -lXau - QMAKE_LIBS_EGL = -lEGL - QMAKE_LIBS_OPENGL = -lGL - QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 diff --git a/nix/nixcrpkgs/pkgs/qt/font-dir.patch b/nix/nixcrpkgs/pkgs/qt/font-dir.patch deleted file mode 100644 index ab83847648..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/font-dir.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- qt-5.8.0-orig/src/gui/text/qplatformfontdatabase.cpp -+++ qt-5.8.0/src/gui/text/qplatformfontdatabase.cpp -@@ -396,7 +396,7 @@ - { - QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR")); - if (fontpath.isEmpty()) -- fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath) + QLatin1String("/fonts"); -+ fontpath = QCoreApplication::applicationDirPath(); - - return fontpath; - } diff --git a/nix/nixcrpkgs/pkgs/qt/license_builder.sh b/nix/nixcrpkgs/pkgs/qt/license_builder.sh deleted file mode 100644 index f0fec23547..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/license_builder.sh +++ /dev/null @@ -1,151 +0,0 @@ -# Last updated for qtbase-opensource-src-5.8.0.tar.xz - -source $setup - -if [ "$version" != "5.9.6" ]; then - echo "You need to update the license fragment builder for Qt $version." - exit 1 -fi - -tar -xf $src -mv qtbase-* qtbase - -# Read the license files here instead of in the big string so it is a fatal -# error if any of them are missing. -license_qt=$(cat qtbase/LICENSE.LGPLv3) -cd qtbase/src/3rdparty -license_android=$(cat android/LICENSE) -license_angle1=$(cat angle/LICENSE) -license_angle2=$(cat angle/TRACEEVENT_LICENSE) -license_angle3=$(cat angle/SYSTEMINFO_LICENSE) -license_dc=$(cat double-conversion/LICENSE) -license_easing=$(cat easing/LICENSE) -license_forkfd=$(cat forkfd/LICENSE) -license_freebsd=$(cat freebsd/LICENSE) -license_freetype=$(cat freetype/docs/GPLv2.TXT) -license_gradle=$(cat gradle/LICENSE-GRADLEW.txt) -license_harfbuzz=$(cat harfbuzz/COPYING) -license_harfbuzz_ng=$(cat harfbuzz-ng/COPYING) -license_ia2=$(cat iaccessible2/LICENSE) -license_libjpeg=$(cat libjpeg/LICENSE) -license_libpng=$(cat libpng/LICENSE) -license_pcre2=$(cat pcre2/LICENCE) -license_pixman=$(cat pixman/LICENSE) -license_rfc6234=$(cat rfc6234/LICENSE) -license_sha3_1=$(cat sha3/BRG_ENDIAN_LICENSE) -license_sha3_2=$(cat sha3/CC0_LICENSE) -license_xcb=$(cat xcb/LICENSE) -license_xkbcommon=$(cat xkbcommon/COPYING) -license_zlib=$(cat zlib/LICENSE) - -cat > $out <Qt - -

- The Qt Toolkit is licensed under the - GNU Lesser General Public License Version 3 (LGPLv3) as shown below. -

- -
-$license_qt
-
- -

Third-party components bundled with Qt

- -

- This software might include code from third-party comoponents bundled with Qt. - The copyright notices of those components are reproduced below. -

- -
-$license_android
-
- -
-$license_angle1
-
- -
-$license_angle2
-
- -
-$license_angle3
-
- -
-$license_dc
-
- -
-$license_easing
-
- -
-$license_forkfd
-
- -
-$license_freebsd
-
- -
-$license_freetype
-
- -
-$license_gradle
-
- -
-$license_harfbuzz
-
- -
-$license_harfbuzz_ng
-
- -
-$license_ia2
-
- -
-$license_libjpeg
-
- -
-$license_libpng
-
- -
-$license_pcre2
-
- -
-$license_pixman
-
- -
-$license_rfc6234
-
- -
-$license_sha3_1
-
- -
-$license_sha3_2
-
- -
-$license_xcb
-
- -
-$license_xkbcommon
-
- -
-$license_zlib
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/qt/macos-config.patch b/nix/nixcrpkgs/pkgs/qt/macos-config.patch deleted file mode 100644 index de8c3a2829..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/macos-config.patch +++ /dev/null @@ -1,167 +0,0 @@ -diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/common/clang.conf qtbase-opensource-src-5.9.2-mac/mkspecs/common/clang.conf ---- qtbase-opensource-src-5.9.2-orig/mkspecs/common/clang.conf 2017-11-03 20:37:01.001539490 -0700 -+++ qtbase-opensource-src-5.9.2-mac/mkspecs/common/clang.conf 2017-11-03 20:46:20.159382848 -0700 -@@ -4,8 +4,8 @@ - - QMAKE_COMPILER = gcc clang llvm # clang pretends to be gcc - --QMAKE_CC = clang --QMAKE_CXX = clang++ -+QMAKE_CC = $${CROSS_COMPILE}clang -+QMAKE_CXX = $${CROSS_COMPILE}clang++ - - QMAKE_LINK_C = $$QMAKE_CC - QMAKE_LINK_C_SHLIB = $$QMAKE_CC -diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/common/clang-mac.conf qtbase-opensource-src-5.9.2-mac/mkspecs/common/clang-mac.conf ---- qtbase-opensource-src-5.9.2-orig/mkspecs/common/clang-mac.conf 2017-11-03 20:37:01.001539490 -0700 -+++ qtbase-opensource-src-5.9.2-mac/mkspecs/common/clang-mac.conf 2017-11-03 20:55:13.878575754 -0700 -@@ -6,8 +6,6 @@ - - QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0 - --QMAKE_CXXFLAGS += -stdlib=libc++ --QMAKE_LFLAGS += -stdlib=libc++ - QMAKE_AR_LTCG = libtool -static -o - - QMAKE_CFLAGS_APPLICATION_EXTENSION = -fapplication-extension -diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/common/mac.conf qtbase-opensource-src-5.9.2-mac/mkspecs/common/mac.conf ---- qtbase-opensource-src-5.9.2-orig/mkspecs/common/mac.conf 2017-11-03 20:37:01.001539490 -0700 -+++ qtbase-opensource-src-5.9.2-mac/mkspecs/common/mac.conf 2017-11-03 22:03:30.960602142 -0700 -@@ -35,10 +35,10 @@ - - QMAKE_ACTOOL = actool - --QMAKE_DSYMUTIL = dsymutil --QMAKE_STRIP = strip -+QMAKE_DSYMUTIL = $${CROSS_COMPILE}dsymutil -+QMAKE_STRIP = $${CROSS_COMPILE}strip - QMAKE_STRIPFLAGS_LIB += -S -x - --QMAKE_AR = ar cq --QMAKE_RANLIB = ranlib -s --QMAKE_NM = nm -P -+QMAKE_AR = $${CROSS_COMPILE}ar cq -+QMAKE_RANLIB = $${CROSS_COMPILE}ranlib -s -+QMAKE_NM = $${CROSS_COMPILE}nm -P -diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/default_post.prf qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/default_post.prf ---- qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/default_post.prf 2017-11-03 20:37:01.008206202 -0700 -+++ qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/default_post.prf 2017-11-03 21:06:25.247871399 -0700 -@@ -2,29 +2,6 @@ - - !no_objective_c:CONFIG += objective_c - --qt { -- qtConfig(static) { -- # C++11 support means using libc++ instead of libstd++. As the -- # two libraries are incompatible we need to ensure the end user -- # project is built using the same C++11 support/no support as Qt. -- qtConfig(c++11) { -- CONFIG += c++11 -- } else: c++11 { -- warning("Qt was not built with C++11 enabled, disabling feature") -- CONFIG -= c++11 -- } -- -- !c++11 { -- # Explicitly use libstdc++ if C++11 support is not enabled, -- # as otherwise the compiler will choose the standard library -- # based on the deployment target, which for iOS 7 and OS X 10.9 -- # is libc++, and we can't mix and match the two. -- QMAKE_CXXFLAGS += -stdlib=libstdc++ -- QMAKE_LFLAGS += -stdlib=libstdc++ -- } -- } --} -- - # Add the same default rpaths as Xcode does for new projects. - # This is especially important for iOS/tvOS/watchOS where no other option is possible. - !no_default_rpath { -@@ -89,10 +66,6 @@ - - arch_flags = $(EXPORT_ARCH_ARGS) - -- QMAKE_CFLAGS += $$arch_flags -- QMAKE_CXXFLAGS += $$arch_flags -- QMAKE_LFLAGS += $$arch_flags -- - QMAKE_PCH_ARCHS = $$VALID_ARCHS - - macos: deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET -@@ -149,9 +122,6 @@ - else: \ - version_identifier = $$device.deployment_identifier - version_min_flag = -m$${version_identifier}-version-min=$$deployment_target -- QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag -- QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag -- QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag - } - - # Enable precompiled headers for multiple architectures -diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/default_pre.prf qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/default_pre.prf ---- qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/default_pre.prf 2017-11-03 20:37:01.008206202 -0700 -+++ qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/default_pre.prf 2017-11-03 20:46:20.159382848 -0700 -@@ -1,43 +1,6 @@ - CONFIG = asset_catalogs rez $$CONFIG - load(default_pre) - --isEmpty(QMAKE_XCODE_DEVELOPER_PATH) { -- # Get path of Xcode's Developer directory -- QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null") -- isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \ -- error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.") -- -- # Make sure Xcode path is valid -- !exists($$QMAKE_XCODE_DEVELOPER_PATH): \ -- error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.") --} -- --isEmpty(QMAKE_XCODEBUILD_PATH): \ -- QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null") -- --!isEmpty(QMAKE_XCODEBUILD_PATH) { -- # Make sure Xcode is set up properly -- !system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \ -- error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.") -- -- isEmpty(QMAKE_XCODE_VERSION) { -- # Extract Xcode version using xcodebuild -- xcode_version = $$system("/usr/bin/xcrun xcodebuild -version") -- QMAKE_XCODE_VERSION = $$member(xcode_version, 1) -- isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.") -- unset(xcode_version) -- } --} -- --isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) { -- QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist -- exists($$QMAKE_XCODE_PREFERENCES_FILE): \ -- QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null") -- -- !isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \ -- cache(QMAKE_TARGET_BUNDLE_PREFIX) --} -- - QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon - - # Make the default debug info format for static debug builds -diff -ur qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/sdk.prf qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/sdk.prf ---- qtbase-opensource-src-5.9.2-orig/mkspecs/features/mac/sdk.prf 2017-11-03 20:37:01.008206202 -0700 -+++ qtbase-opensource-src-5.9.2-mac/mkspecs/features/mac/sdk.prf 2017-11-03 20:46:20.159382848 -0700 -@@ -18,7 +18,7 @@ - sdk = $$QMAKE_MAC_SDK - - isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) { -- QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$info 2>/dev/null") -+ QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("xcrun --sdk $$sdk $$info 2>/dev/null") - # --show-sdk-platform-path won't work for Command Line Tools; this is fine - # only used by the XCTest backend to testlib - isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(info, "--show-sdk-platform-path")): \ -@@ -50,7 +50,7 @@ - value = $$eval($$tool) - isEmpty(value): next() - -- sysrooted = $$system("/usr/bin/xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null") -+ sysrooted = $$system("xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null") - isEmpty(sysrooted): next() - - $$tool = $$sysrooted $$member(value, 1, -1) diff --git a/nix/nixcrpkgs/pkgs/qt/pc-debug-name.patch b/nix/nixcrpkgs/pkgs/qt/pc-debug-name.patch deleted file mode 100644 index 690e8bea74..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/pc-debug-name.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 995313e0795df5500fd84350e80a3f88202b473d Mon Sep 17 00:00:00 2001 -From: Martchus -Date: Sun, 18 Sep 2016 14:01:14 +0200 -Subject: [PATCH 07/30] Prevent debug library names in pkg-config files - -qmake generates the pkgconfig .pc files two times, once for the -release build and once for the debug build (which we're not actually -building in this package). For both generations the exact same -pkgconfig file name is used. This causes references to the debug -build ending up in the .pc files which are unwanted -Prevent this from happening by giving the pkgconfig .pc -files for the debug build an unique file name. ---- - qmake/generators/makefile.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp -index 182fe79238..a762443fe2 100644 ---- a/qmake/generators/makefile.cpp -+++ b/qmake/generators/makefile.cpp -@@ -3164,6 +3164,9 @@ MakefileGenerator::pkgConfigFileName(bool fixify, bool onlyPrependDestdir) - if (dot != -1) - ret = ret.left(dot); - } -+ if (project->isActiveConfig("debug")) { -+ ret += "d"; -+ } - ret += Option::pkgcfg_ext; - QString subdir = project->first("QMAKE_PKGCONFIG_DESTDIR").toQString(); - if(!subdir.isEmpty()) { --- -2.11.1 - diff --git a/nix/nixcrpkgs/pkgs/qt/pkg-config-cross.patch b/nix/nixcrpkgs/pkgs/qt/pkg-config-cross.patch deleted file mode 100644 index 506df0ff8d..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/pkg-config-cross.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ur qt-orig/configure.pri qt/configure.pri ---- qt-orig/configure.pri 2017-07-27 18:16:48.205591390 -0700 -+++ qt/configure.pri 2017-07-29 13:11:08.957085166 -0700 -@@ -139,7 +139,8 @@ - } - } - -- $$qtConfEvaluate("features.cross_compile") { -+ qtLog("Blindly trusting this pkg-config to be valid."); -+ false { - # cross compiling, check that pkg-config is set up sanely - sysroot = $$config.input.sysroot - diff --git a/nix/nixcrpkgs/pkgs/qt/win32-link-object-max.patch b/nix/nixcrpkgs/pkgs/qt/win32-link-object-max.patch deleted file mode 100644 index c47279b2ee..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/win32-link-object-max.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -ur qtbase-opensource-src-5.9.6-orig/mkspecs/win32-g++/qmake.conf qtbase-opensource-src-5.9.6/mkspecs/win32-g++/qmake.conf ---- qtbase-opensource-src-5.9.6-orig/mkspecs/win32-g++/qmake.conf 2018-06-19 12:41:49.061465695 -0700 -+++ qtbase-opensource-src-5.9.6/mkspecs/win32-g++/qmake.conf 2018-06-19 12:42:15.406453120 -0700 -@@ -54,10 +54,8 @@ - QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows - QMAKE_LFLAGS_DLL = -shared - QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections --equals(QMAKE_HOST.os, Windows) { -- QMAKE_LINK_OBJECT_MAX = 10 -- QMAKE_LINK_OBJECT_SCRIPT = object_script --} -+QMAKE_LINK_OBJECT_MAX = 10 -+QMAKE_LINK_OBJECT_SCRIPT = object_script - QMAKE_EXT_OBJ = .o - QMAKE_EXT_RES = _res.o - QMAKE_PREFIX_SHLIB = diff --git a/nix/nixcrpkgs/pkgs/qt/wrapper_builder.rb b/nix/nixcrpkgs/pkgs/qt/wrapper_builder.rb deleted file mode 100644 index 49b3efd8a0..0000000000 --- a/nix/nixcrpkgs/pkgs/qt/wrapper_builder.rb +++ /dev/null @@ -1,499 +0,0 @@ -require 'pathname' -require 'fileutils' -include FileUtils - -STDOUT.sync = true - -ENV['PATH'] = ENV.fetch('_PATH') - -Os = ENV.fetch('os') -QtVersionString = ENV.fetch('version') -QtVersionMajor = QtVersionString.split('.').first.to_i - -QtBaseDir = Pathname(ENV.fetch('qtbase')) - -OutDir = Pathname(ENV.fetch('out')) -OutPcDir = OutDir + 'lib' + 'pkgconfig' -CMakeDir = OutDir + 'lib' + 'cmake' -OutIncDir = OutDir + 'include' -MocExe = OutDir + 'bin' + 'moc' -RccExe = OutDir + 'bin' + 'rcc' - -DepGraph = {} -DepGraphBack = {} - -DepInfo = {} -DepInfo.default_proc = proc do |hash, name| - hash[name] = find_dep_info(name) -end - -case Os -when "windows" - PrlPrefix = '' -else - PrlPrefix = 'lib' -end - -# Note: These dependencies just came from me fixing errors for specific -# programs. There are likely misisng dependencies in this graph, and there -# might be a few dependencies that could be safely removed because they are -# purely transitive. -def make_dep_graph - # High-level dependencies. - add_dep 'Qt5Widgets.x', 'libQt5Widgets.a' - add_dep 'Qt5Widgets.x', 'Qt5Gui.x' - add_dep 'Qt5Gui.x', 'Qt5GuiNoPlugins.x' - add_dep 'Qt5GuiNoPlugins.x', 'libQt5Gui.a' - add_dep 'Qt5GuiNoPlugins.x', 'Qt5Core.x' - add_dep 'Qt5Core.x', 'libQt5Core.a' - - # Include directories. - add_dep 'Qt5Core.x', '-I' + OutIncDir.to_s - add_dep 'Qt5Core.x', '-I' + (OutIncDir + 'QtCore').to_s - add_dep 'Qt5Gui.x', '-I' + (OutIncDir + 'QtGui').to_s - add_dep 'Qt5Widgets.x', '-I' + (OutIncDir + 'QtWidgets').to_s - - # Libraries that Qt depends on. - add_dep 'libQt5Widgets.a', 'libQt5Gui.a' - add_dep 'libQt5FontDatabaseSupport.a', 'libqtfreetype.a' - add_dep 'libQt5Gui.a', 'libQt5Core.a' - add_dep 'libQt5Gui.a', 'libqtlibpng.a' - add_dep 'libQt5Gui.a', 'libqtharfbuzz.a' - add_dep 'libQt5Core.a', 'libqtpcre2.a' - - if Os == 'windows' - add_dep 'Qt5Gui.x', 'qwindows.x' - add_dep 'qwindows.x', 'libqwindows.a' - - add_dep 'libqwindows.a', '-ldwmapi' - add_dep 'libqwindows.a', '-limm32' - add_dep 'libqwindows.a', '-loleaut32' - add_dep 'libqwindows.a', 'libQt5Gui.a' - add_dep 'libqwindows.a', 'libQt5EventDispatcherSupport.a' - add_dep 'libqwindows.a', 'libQt5FontDatabaseSupport.a' - add_dep 'libqwindows.a', 'libQt5ThemeSupport.a' - - add_dep 'libQt5Core.a', '-lole32' - add_dep 'libQt5Core.a', '-luuid' - add_dep 'libQt5Core.a', '-lversion' - add_dep 'libQt5Core.a', '-lwinmm' - add_dep 'libQt5Core.a', '-lws2_32' - - add_dep 'libQt5Gui.a', '-lopengl32' - - add_dep 'libQt5Widgets.a', '-luxtheme' - end - - if Os == 'linux' - add_dep 'Qt5Gui.x', 'qlinuxfb.x' - add_dep 'Qt5Gui.x', 'qxcb.x' - add_dep 'qlinuxfb.x', 'libqlinuxfb.a' - add_dep 'qxcb.x', 'libqxcb.a' - - add_dep 'libqlinuxfb.a', 'libQt5FbSupport.a' - add_dep 'libqlinuxfb.a', 'libQt5InputSupport.a' - - add_dep 'libqxcb.a', 'libQt5XcbQpa.a' - - add_dep 'libQt5DBus.a', 'libQt5Core.a' - add_dep 'libQt5DBus.a', 'libQt5Gui.a' - add_dep 'libQt5DeviceDiscoverySupport.a', 'libudev.pc' - add_dep 'libQt5InputSupport.a', 'libQt5DeviceDiscoverySupport.a' - add_dep 'libQt5LinuxAccessibilitySupport.a', 'libQt5AccessibilitySupport.a' - add_dep 'libQt5LinuxAccessibilitySupport.a', 'libQt5DBus.a' - add_dep 'libQt5LinuxAccessibilitySupport.a', 'xcb-aux.pc' - add_dep 'libQt5ThemeSupport.a', 'libQt5DBus.a' - - add_dep 'libQt5XcbQpa.a', 'libQt5EventDispatcherSupport.a' - add_dep 'libQt5XcbQpa.a', 'libQt5FontDatabaseSupport.a' - add_dep 'libQt5XcbQpa.a', 'libQt5Gui.a' - add_dep 'libQt5XcbQpa.a', 'libQt5LinuxAccessibilitySupport.a' - add_dep 'libQt5XcbQpa.a', 'libQt5ServiceSupport.a' - add_dep 'libQt5XcbQpa.a', 'libQt5ThemeSupport.a' - add_dep 'libQt5XcbQpa.a', 'x11.pc' - add_dep 'libQt5XcbQpa.a', 'x11-xcb.pc' - add_dep 'libQt5XcbQpa.a', 'xcb.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-icccm.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-image.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-keysyms.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-randr.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-renderutil.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-shape.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-shm.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-sync.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-xfixes.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-xinerama.pc' - add_dep 'libQt5XcbQpa.a', 'xcb-xkb.pc' - add_dep 'libQt5XcbQpa.a', 'xi.pc' - end - - if Os == 'macos' - add_dep 'Qt5Gui.x', 'qcocoa.x' - add_dep 'qcocoa.x', 'libqcocoa.a' - - add_dep 'libqcocoa.a', 'libcocoaprintersupport.a' - add_dep 'libqcocoa.a', '-lcups' # Also available: -lcups.2 - add_dep 'libqcocoa.a', 'libQt5AccessibilitySupport.a' - add_dep 'libqcocoa.a', 'libQt5ClipboardSupport.a' - add_dep 'libqcocoa.a', 'libQt5CglSupport.a' - add_dep 'libqcocoa.a', 'libQt5GraphicsSupport.a' - add_dep 'libqcocoa.a', 'libQt5FontDatabaseSupport.a' - add_dep 'libqcocoa.a', 'libQt5ThemeSupport.a' - add_dep 'libqcocoa.a', 'libQt5PrintSupport.a' - - add_dep 'libqtlibpng.a', '-lz' - - add_dep 'libQt5Core.a', '-lobjc' - add_dep 'libQt5Core.a', '-framework CoreServices' - add_dep 'libQt5Core.a', '-framework CoreText' - add_dep 'libQt5Gui.a', '-framework CoreGraphics' - add_dep 'libQt5Gui.a', '-framework OpenGL' - add_dep 'libQt5Widgets.a', '-framework Carbon' - add_dep 'libQt5Widgets.a', '-framework AppKit' - end - - add_deps_of_pc_files -end - -# Qt depends on some system libraries with .pc files. It tends to only depend -# on these things at link time, not compile time. So use pkg-config with --libs -# to get those dependencies, for use in .cmake files. -def add_deps_of_pc_files - DepGraph.keys.each do |dep| - next if determine_dep_type(dep) != :pc - name = dep.chomp('.pc') - new_deps = `pkg-config-cross --libs #{name}`.split(' ') - raise "Failed to #{dep} libs" if $?.exitstatus != 0 - new_deps.each do |new_dep| - add_dep dep, new_dep - end - end -end - -def add_dep(library, *deps) - a = DepGraph[library] ||= [] - DepGraphBack[library] ||= [] - deps.each do |dep| - DepGraph[dep] ||= [] - a << dep unless a.include? dep - (DepGraphBack[dep] ||= []) << library - end -end - -# Given a name of a dep in the graph, figure out what kind of dep -# it use. -def determine_dep_type(name) - extension = Pathname(name).extname - case - when extension == '.a' then :a - when extension == '.pc' then :pc - when extension == '.x' then :x - when name.start_with?('-I') then :incdirflag - when name.start_with?('-L') then :libdirflag - when name.start_with?('-l') then :ldflag - when name.start_with?('-framework') then :ldflag - end -end - -def find_pkg_config_file(name) - ENV.fetch('PKG_CONFIG_CROSS_PATH').split(':').each do |dir| - path = Pathname(dir) + name - return path if path.exist? - end - nil -end - -def find_qt_library(name) - debug_name = Pathname(name).sub_ext("d.a").to_s - - search_dirs = [ OutDir + 'lib' ] + - (OutDir + 'plugins').children - - search_dirs.each do |dir| - lib = dir + name - return lib if lib.exist? - end - - search_dirs.each do |dir| - lib = dir + debug_name - return lib if lib.exist? - end - - nil -end - -def find_dep_info(name) - case determine_dep_type(name) - when :a then find_qt_library(name) - when :pc then find_pkg_config_file(name) - end -end - -# Given an array of dependencies and a block for retrieving dependencies of an -# dependency, returns an array of dependencies with three guarantees: -# -# 1) Contains all the listed dependencies. -# 2) Has no duplicates. -# 3) For any dependency in the list, all of its dependencies are before it. -# -# Guarantee 3 only holds if the underlying graph has no circul dependencies. If -# there is a circular dependency, it will not be detected, but it will not cause -# an infinite loop either. -def flatten_deps(deps) - work = [].concat(deps) - expanded = {} - output = {} - while !work.empty? - dep = work.last - if expanded[dep] - output[dep] = true - work.pop - else - expanded[dep] = true - deps = yield dep - work.concat(deps) - end - end - output.keys # relies on Ruby's ordered hashes -end - -def canonical_x_file(dep) - return nil if determine_dep_type(dep) != :a - x_files = DepGraphBack.fetch(dep).select do |name| - determine_dep_type(name) == :x - end - if x_files.size > 2 - raise "There is more than one .x file #{dep}." - end - x_files.first -end - -# Note: It would be nice to find some solution so that Qt5Widgets.pc does not -# require Qt5GuiNoPlugins, since it already requires Qt5Gui. -def flatten_deps_for_pc_file(pc_file) - flatten_deps(DepGraph[pc_file]) do |dep| - deps = case determine_dep_type(dep) - when :x, :pc then - # Don't expand dependencies for a .pc file because we can just - # refer to them with the Requires line in our .pc file. - [] - else DepGraph.fetch(dep) - end - - # Replace .a files with a canonical .x file if there is one. - deps.map do |name| - substitute = canonical_x_file(name) - substitute = nil if substitute == pc_file - substitute || name - end - end -end - -def flatten_deps_for_cmake_file(cmake_file) - flatten_deps(DepGraph[cmake_file]) do |dep| - DepGraph.fetch(dep) - end -end - -def create_pc_file(name) - requires = [] - libdirs = [] - ldflags = [] - cflags = [] - - deps = flatten_deps_for_pc_file(name) - - deps.each do |dep| - dep = dep.dup - case determine_dep_type(dep) - when :a then - full_path = DepInfo[dep] - raise "Could not find library: #{dep}" if !full_path - libdir = full_path.dirname.to_s - libdir.sub!((OutDir + 'lib').to_s, '${libdir}') - libdir.sub!(OutDir.to_s, '${prefix}') - libname = full_path.basename.to_s - libname.sub!(/\Alib/, '') - libname.sub!(/.a\Z/, '') - libdirs << "-L#{libdir}" - ldflags << "-l#{libname}" - when :x then - dep.chomp!('.x') - requires << dep - when :pc then - dep.chomp!('.pc') - requires << dep - when :ldflag then - ldflags << dep - when :libdirflag then - libdirs << dep - when :incdirflag then - dep.sub!(OutIncDir.to_s, '${includedir}') - cflags << dep - end - end - - r = "" - r << "prefix=#{OutDir}\n" - r << "libdir=${prefix}/lib\n" - r << "includedir=${prefix}/include\n" - r << "Version: #{QtVersionString}\n" - if !libdirs.empty? || !ldflags.empty? - r << "Libs: #{libdirs.reverse.uniq.join(' ')} #{ldflags.reverse.join(' ')}\n" - end - if !cflags.empty? - r << "Cflags: #{cflags.join(' ')}\n" - end - if !requires.empty? - r << "Requires: #{requires.sort.join(' ')}\n" - end - - path = OutPcDir + Pathname(name).sub_ext(".pc") - File.open(path.to_s, 'w') do |f| - f.write r - end -end - -# For .pc files we depend on, add symlinks to the .pc file and any other .pc -# files in the same directory which might be transitive dependencies. -def symlink_pc_file_closure(name) - dep_pc_dir = DepInfo[name].dirname - dep_pc_dir.each_child do |target| - link = OutPcDir + target.basename - - # Skip it if we already made this link. - next if link.symlink? - - # Link directly to the real PC file. - target = target.realpath - - ln_s target, link - end -end - -def create_pc_files - mkdir OutPcDir - DepGraph.each_key do |name| - case determine_dep_type(name) - when :x then create_pc_file(name) - when :pc then symlink_pc_file_closure(name) - end - end -end - -def set_property(f, target_name, property_name, value) - if value.is_a?(Array) - value = value.map do |entry| - if entry.to_s.include?(' ') - "\"#{entry}\"" - else - entry - end - end.join(' ') - end - - f.puts "set_property(TARGET #{target_name} " \ - "PROPERTY #{property_name} #{value})" -end - -def set_properties(f, target_name, properties) - properties.each do |property_name, value| - set_property(f, target_name, property_name, value) - end -end - -def import_static_lib(f, target_name, properties) - f.puts "add_library(#{target_name} STATIC IMPORTED)" - set_properties(f, target_name, properties) -end - -def create_cmake_core_files - File.open(CMakeDir + 'core.cmake', 'w') do |f| - f.puts "set(QT_VERSION_MAJOR #{QtVersionMajor})" - f.puts - - f.puts "set(QT_MOC_EXECUTABLE #{MocExe})" - f.puts "add_executable(Qt5::moc IMPORTED)" - f.puts "set_target_properties(Qt5::moc PROPERTIES " \ - "IMPORTED_LOCATION ${QT_MOC_EXECUTABLE})" - f.puts - - f.puts "add_executable(Qt5::rcc IMPORTED)" - f.puts "set_target_properties(Qt5::rcc PROPERTIES " \ - "IMPORTED_LOCATION #{RccExe})" - f.puts "set(Qt5Core_RCC_EXECUTABLE Qt5::rcc)" - f.puts - - f.write File.read(ENV.fetch('core_macros')) - end -end - -def create_cmake_qt5widgets - mkdir CMakeDir + 'Qt5Widgets' - - widgets_a = find_qt_library('libQt5Widgets.a') || raise - - deps = flatten_deps_for_cmake_file('Qt5Widgets.x') - - incdirs = [] - libdirflags = [] - ldflags = [] - deps.each do |dep| - dep = dep.dup - case determine_dep_type(dep) - when :a then - full_path = DepInfo[dep] - raise "Could not find library: #{dep}" if !full_path - libdir = full_path.dirname.to_s - libname = full_path.basename.to_s - libname.sub!(/\Alib/, '') - libname.sub!(/.a\Z/, '') - libdirflags << "-L#{libdir}" - ldflags << "-l#{libname}" - when :ldflag then - ldflags << dep - when :libdirflag then - libdirflags << dep - when :incdirflag then - incdir = dep.sub(/\A-I/, '') - incdirs << incdir - end - end - - File.open(CMakeDir + 'Qt5Widgets' + 'Qt5WidgetsConfig.cmake', 'w') do |f| - import_static_lib f, 'Qt5::Widgets', - IMPORTED_LOCATION: widgets_a, - IMPORTED_LINK_INTERFACE_LANGUAGES: 'CXX', - INTERFACE_LINK_LIBRARIES: libdirflags.reverse.uniq + ldflags.reverse, - INTERFACE_INCLUDE_DIRECTORIES: incdirs, - INTERFACE_COMPILE_DEFINITIONS: 'QT_STATIC' - - f.puts "include(#{CMakeDir + 'core.cmake'})" - end -end - -def main - # Symlink the include, bin, and plugins directories into $out. - mkdir OutDir - ln_s QtBaseDir + 'include', OutDir + 'include' - ln_s QtBaseDir + 'bin', OutDir + 'bin' - ln_s QtBaseDir + 'plugins', OutDir + 'plugins' - ln_s QtBaseDir + 'src', OutDir + 'src' - - # Symlink the .a files and copy the .prl files into $out/lib. - mkdir OutDir + 'lib' - (QtBaseDir + 'lib').each_child do |c| - ln_s c, OutDir + 'lib' if c.extname == '.a' - cp c, OutDir + 'lib' if c.extname == '.prl' - end - - make_dep_graph - - create_pc_files - - mkdir CMakeDir - create_cmake_core_files - create_cmake_qt5widgets -end - -main diff --git a/nix/nixcrpkgs/pkgs/readline/builder.sh b/nix/nixcrpkgs/pkgs/readline/builder.sh deleted file mode 100644 index defaa8b7d3..0000000000 --- a/nix/nixcrpkgs/pkgs/readline/builder.sh +++ /dev/null @@ -1,32 +0,0 @@ -source $setup - -# This is from the mingw-w64-readline AUR arch package. -export bash_cv_wcwidth_broken=no - -tar -xf $src - -cd readline-$version -for patch in $patches_p2; do - echo applying patch $patch - patch -p2 -i $patch -done -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done -cd .. - -mkdir build -cd build - -../readline-$version/configure \ - --prefix=$out --host=$host \ - --enable-static --disable-shared \ - --with-curses=$curses - -make - -make install - -mkdir $out/license -cp ../readline-$version/COPYING $out/license/LICENSE diff --git a/nix/nixcrpkgs/pkgs/readline/default.nix b/nix/nixcrpkgs/pkgs/readline/default.nix deleted file mode 100644 index b1369e70f9..0000000000 --- a/nix/nixcrpkgs/pkgs/readline/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -# Note: This has only been tested on Windows, and is using pdcurses -# which only seems to work on Windows. - -{ crossenv, curses }: - -let - fetchurl = crossenv.nixpkgs.fetchurl; -in -crossenv.make_derivation rec { - name = "readline-${version}"; - - version = "7.0"; - - src = fetchurl { - url = "mirror://gnu/readline/readline-${version}.tar.gz"; - sha256 = "0d13sg9ksf982rrrmv5mb6a2p4ys9rvg9r71d6il0vr8hmql63bm"; - }; - - patches_p2 = [ - (fetchurl { - url = "mirror://gnu/readline/readline-7.0-patches/readline70-001"; - sha256 = "0xm3sxvwmss7ddyfb11n6pgcqd1aglnpy15g143vzcf75snb7hcs"; - }) - (fetchurl { - url = "mirror://gnu/readline/readline-7.0-patches/readline70-002"; - sha256 = "0n1dxmqsbjgrfxb1hgk5c6lsraw4ncbnzxlsx7m35nym6lncjiw7"; - }) - (fetchurl { - url = "mirror://gnu/readline/readline-7.0-patches/readline70-003"; - sha256 = "1027kmymniizcy0zbdlrczxfx3clxcdln5yq05q9yzlc6y9slhwy"; - }) - ]; - - patches = [ - ./readline-1.patch - ]; - - builder = ./builder.sh; - - inherit curses; -} diff --git a/nix/nixcrpkgs/pkgs/readline/readline-1.patch b/nix/nixcrpkgs/pkgs/readline/readline-1.patch deleted file mode 100644 index 52938b8048..0000000000 --- a/nix/nixcrpkgs/pkgs/readline/readline-1.patch +++ /dev/null @@ -1,171 +0,0 @@ -We got this patch from the mingw-w64-readline AUR Arch package. - -This patch originall comes from MXE, and is licensed under the MIT license. - -https://github.com/mxe/mxe/blob/master/src/readline-1.patch - -Copyright (c) 2007-2016 - -Volker Diels-Grabsch -Mark Brand -Tony Theodore -Martin Gerhardy -Tiancheng "Timothy" Gu -Boris Nagaev -... and many other contributors -(contact via the project mailing list or issue tracker) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of -the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -From 6896ffa4fc85bf0dfae58e69a860d2076c1d9fd2 Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Tue, 30 Sep 2014 17:16:32 -0700 -Subject: [PATCH 2/2] Handle missing S_IS* macros more gracefully - -diff --git a/colors.c b/colors.c -index 89d9035..ec19844 100644 ---- a/colors.c -+++ b/colors.c -@@ -152,14 +152,22 @@ _rl_print_color_indicator (char *f) - { - colored_filetype = C_FILE; - -+#if defined (S_ISUID) - if ((mode & S_ISUID) != 0 && is_colored (C_SETUID)) - colored_filetype = C_SETUID; -- else if ((mode & S_ISGID) != 0 && is_colored (C_SETGID)) -+ else -+#endif -+#if defined (S_ISGID) -+ if ((mode & S_ISGID) != 0 && is_colored (C_SETGID)) - colored_filetype = C_SETGID; -- else if (is_colored (C_CAP) && 0) //f->has_capability) -+ else -+#endif -+ if (is_colored (C_CAP) && 0) //f->has_capability) - colored_filetype = C_CAP; -+#if defined(S_IXUGO) - else if ((mode & S_IXUGO) != 0 && is_colored (C_EXEC)) - colored_filetype = C_EXEC; -+#endif - else if ((1 < astat.st_nlink) && is_colored (C_MULTIHARDLINK)) - colored_filetype = C_MULTIHARDLINK; - } -@@ -173,8 +181,10 @@ _rl_print_color_indicator (char *f) - colored_filetype = C_STICKY_OTHER_WRITABLE; - else - #endif -+#if defined (S_IWOTH) - if ((mode & S_IWOTH) != 0 && is_colored (C_OTHER_WRITABLE)) - colored_filetype = C_OTHER_WRITABLE; -+#endif - #if defined (S_ISVTX) - else if ((mode & S_ISVTX) != 0 && is_colored (C_STICKY)) - colored_filetype = C_STICKY; -diff --git a/colors.h b/colors.h -index fc926e5..e62edd0 100644 ---- a/colors.h -+++ b/colors.h -@@ -96,7 +96,7 @@ enum indicator_no - }; - - --#if !S_IXUGO -+#if !S_IXUGO && defined(S_IXUSR) && defined(S_IXGRP) && defined(S_IXOTH) - # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) - #endif - -diff --git a/posixstat.h b/posixstat.h -index 3eb7f29..854a2c9 100644 ---- a/posixstat.h -+++ b/posixstat.h -@@ -78,30 +78,44 @@ - - #if defined (S_IFBLK) && !defined (S_ISBLK) - #define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) /* block device */ -+#elif !defined (S_IFBLK) -+#define S_ISBLK(m) 0 - #endif - - #if defined (S_IFCHR) && !defined (S_ISCHR) - #define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) /* character device */ -+#elif !defined (S_IFCHR) -+#define S_ISCHR(m) 0 - #endif - - #if defined (S_IFDIR) && !defined (S_ISDIR) - #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) /* directory */ -+#elif !defined (S_IFDIR) -+#define S_ISDIR(m) 0 - #endif - - #if defined (S_IFREG) && !defined (S_ISREG) - #define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) /* file */ -+#elif !defined (S_IFREG) -+#define S_ISREG(m) 0 - #endif - - #if defined (S_IFIFO) && !defined (S_ISFIFO) - #define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) /* fifo - named pipe */ -+#elif !defined (S_IFIFO) -+#define S_ISFIFO(m) 0 - #endif - - #if defined (S_IFLNK) && !defined (S_ISLNK) - #define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) /* symbolic link */ -+#elif !defined (S_IFLNK) -+#define S_ISLNK(m) 0 - #endif - - #if defined (S_IFSOCK) && !defined (S_ISSOCK) - #define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) /* socket */ -+#elif !defined (S_IFSOCK) -+#define S_ISSOCK(m) 0 - #endif - - /* -@@ -137,6 +151,8 @@ - /* These are non-standard, but are used in builtins.c$symbolic_umask() */ - #define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) - #define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) -+#if defined(S_IXUSR) && defined(S_IXGRP) && defined(S_IXOTH) - #define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) -+#endif - - #endif /* _POSIXSTAT_H_ */ --- -1.8.3.2 - -diff --git a/histfile.c b/histfile.c ---- a/histfile.c -+++ b/histfile.c -@@ -610,8 +610,6 @@ - user is running this, it's a no-op. If the shell is running after sudo - with a shared history file, we don't want to leave the history file - owned by root. */ -- if (rv == 0 && exists) -- r = chown (filename, finfo.st_uid, finfo.st_gid); - - xfree (filename); - FREE (tempname); -@@ -757,8 +755,6 @@ - user is running this, it's a no-op. If the shell is running after sudo - with a shared history file, we don't want to leave the history file - owned by root. */ -- if (rv == 0 && exists) -- mode = chown (histname, finfo.st_uid, finfo.st_gid); - - FREE (histname); - FREE (tempname); diff --git a/nix/nixcrpkgs/pkgs/tic/builder.sh b/nix/nixcrpkgs/pkgs/tic/builder.sh deleted file mode 100644 index 5052b2583a..0000000000 --- a/nix/nixcrpkgs/pkgs/tic/builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $setup - -tar -xf $src -mv pololu-tic-software-* tic - -mkdir build -cd build - -cmake-cross ../tic \ - -DCMAKE_INSTALL_PREFIX=$out \ - -DBUILD_SHARED_LIBS=false - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/tic/default.nix b/nix/nixcrpkgs/pkgs/tic/default.nix deleted file mode 100644 index 6f870d911c..0000000000 --- a/nix/nixcrpkgs/pkgs/tic/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ crossenv, qt, libusbp }: - -crossenv.make_derivation rec { - name = "tic-${version}"; - - version = "e1693cd"; # 1.5.0ish - - src = crossenv.nixpkgs.fetchurl { - url = "https://github.com/pololu/pololu-tic-software/archive/${version}.tar.gz"; - sha256 = "07m75w0walr61yqki7h1ipzbfz7x417g7qnx0p1l6qdz89fyc7i8"; - }; - - builder = ./builder.sh; - - cross_inputs = [ libusbp qt ]; -} diff --git a/nix/nixcrpkgs/pkgs/usbview/builder.sh b/nix/nixcrpkgs/pkgs/usbview/builder.sh deleted file mode 100644 index 3aa4cb9019..0000000000 --- a/nix/nixcrpkgs/pkgs/usbview/builder.sh +++ /dev/null @@ -1,31 +0,0 @@ -source $setup - -cp --no-preserve=mode -r $src/usb/usbview . - -cd usbview -rm usbschema.hpp xmlhelper.cpp -for patch in $patches; do - echo applying patch $patch - patch -p1 -i $patch -done -cp $my_xmlhelper_c . -cd .. - -mkdir build -cd build - -$host-windres ../usbview/uvcview.rc rc.o - -# TODO: after fixing bug with selectany in GCC, remove -DINITGUID - -$host-gcc -mwindows -std=gnu99 -O2 \ - -Iinclude \ - -DNTDDI_VERSION=0x06020000 -D_WIN32_WINNT=0x0602 \ - -DSTRSAFE_NO_DEPRECATE -Doffsetof=__builtin_offsetof \ - ../usbview/*.c rc.o \ - -lcomctl32 -lcomdlg32 -lsetupapi -lshell32 -lshlwapi -lole32 -lgdi32 \ - -o usbview.exe - -mkdir -p $out/bin $out/license -cp usbview.exe $out/bin -cp $src/LICENSE $out/license diff --git a/nix/nixcrpkgs/pkgs/usbview/default.nix b/nix/nixcrpkgs/pkgs/usbview/default.nix deleted file mode 100644 index 7d5260859a..0000000000 --- a/nix/nixcrpkgs/pkgs/usbview/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ crossenv }: - -if crossenv.os != "windows" then "windows only" else - -crossenv.make_derivation rec { - name = "usbview-${version}"; - - version = "2017-05-01"; - - src = crossenv.nixpkgs.fetchFromGitHub { - owner = "Microsoft"; - repo = "Windows-driver-samples"; - rev = "4c5c5e0297c7a61e151f92af702cdac650a14489"; - sha256 = "1drq26bnad98xqn805qx0b6g4y65lmrdj7v40b3jhhzdsp8993pf"; - }; - - patches = [ ./megapatch.patch ]; - - my_xmlhelper_c = ./my_xmlhelper.c; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pkgs/usbview/megapatch.patch b/nix/nixcrpkgs/pkgs/usbview/megapatch.patch deleted file mode 100644 index fe3227aee6..0000000000 --- a/nix/nixcrpkgs/pkgs/usbview/megapatch.patch +++ /dev/null @@ -1,107 +0,0 @@ -diff -ur usbview-orig/usbdesc.h usbview/usbdesc.h ---- usbview-orig/usbdesc.h 2017-04-01 16:00:09.314007997 -0700 -+++ usbview/usbdesc.h 2017-04-01 16:10:23.667341332 -0700 -@@ -81,7 +81,7 @@ - #define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07 - #define USB_INTERFACE_POWER_DESCRIPTOR_TYPE 0x08 - #define USB_OTG_DESCRIPTOR_TYPE 0x09 --#define USB_DEBUG_DESCRIPTOR_TYPE 0x0A -+//#define USB_DEBUG_DESCRIPTOR_TYPE 0x0A - #define USB_IAD_DESCRIPTOR_TYPE 0x0B - - // -diff -ur usbview-orig/uvcdesc.h usbview/uvcdesc.h ---- usbview-orig/uvcdesc.h 2017-04-01 16:00:09.314007997 -0700 -+++ usbview/uvcdesc.h 2017-04-01 17:43:09.134007999 -0700 -@@ -15,7 +15,7 @@ - - - // USB Video Device Class Code --#define USB_DEVICE_CLASS_VIDEO 0x0E -+//#define USB_DEVICE_CLASS_VIDEO 0x0E - - // Video sub-classes - #define SUBCLASS_UNDEFINED 0x00 -diff -ur usbview-orig/uvcview.h usbview/uvcview.h ---- usbview-orig/uvcview.h 2017-04-01 16:00:09.314007997 -0700 -+++ usbview/uvcview.h 2017-04-03 20:25:08.145676664 -0700 -@@ -34,10 +33,10 @@ - #include - #include - #include --#include - #include - #include - #include -+#include - #include - #include - #include -@@ -50,6 +49,8 @@ - #include - #include - #include -+#include -+#include - - // This is mostly a private USB Audio descriptor header - #include "usbdesc.h" -@@ -381,7 +382,7 @@ - // ENUM.C - // - --PCHAR ConnectionStatuses[]; -+extern PCHAR ConnectionStatuses[]; - - // - // DISPVID.C -Only in usbview: uvcview.h.orig -diff -ur usbview-orig/uvcview.rc usbview/uvcview.rc ---- usbview-orig/uvcview.rc 2017-04-01 16:00:09.314007997 -0700 -+++ usbview/uvcview.rc 2017-04-01 16:04:07.210674665 -0700 -@@ -22,19 +22,19 @@ - // - // ICON - // --IDI_ICON ICON DISCARDABLE "USB.ICO" --IDI_BADICON ICON DISCARDABLE "BANG.ICO" --IDI_COMPUTER ICON DISCARDABLE "MONITOR.ICO" --IDI_HUB ICON DISCARDABLE "HUB.ICO" --IDI_NODEVICE ICON DISCARDABLE "PORT.ICO" --IDI_NOSSDEVICE ICON DISCARDABLE "SSPORT.ICO" --IDI_SSICON ICON DISCARDABLE "SSUSB.ICO" -+IDI_ICON ICON DISCARDABLE "usb.ico" -+IDI_BADICON ICON DISCARDABLE "bang.ico" -+IDI_COMPUTER ICON DISCARDABLE "monitor.ico" -+IDI_HUB ICON DISCARDABLE "hub.ico" -+IDI_NODEVICE ICON DISCARDABLE "port.ico" -+IDI_NOSSDEVICE ICON DISCARDABLE "ssport.ico" -+IDI_SSICON ICON DISCARDABLE "ssusb.ico" - - ////////////////////////////////////////////////////////////////////////////// - // - // Cursor - // --IDC_SPLIT CURSOR DISCARDABLE "SPLIT.CUR" -+IDC_SPLIT CURSOR DISCARDABLE "split.cur" - - ///////////////////////////////////////////////////////////////////////////// - // -@@ -84,7 +84,7 @@ - BEGIN - MENUITEM "&Refresh\tF5", ID_REFRESH - MENUITEM SEPARATOR -- MENUITEM "Save Current &View ..." ID_SAVE -+ MENUITEM "Save Current &View ...", ID_SAVE - MENUITEM "Save As (&txt) ...", ID_SAVEALL - MENUITEM "Save As (&xml) ...\tF2", ID_SAVEXML - MENUITEM SEPARATOR -@@ -130,7 +130,7 @@ - BEGIN - IDS_STANDARD_FONT "Courier" - IDS_STANDARD_FONT_HEIGHT "\13" -- IDS_STANDARD_FONT_WIDTH "\8" -+ IDS_STANDARD_FONT_WIDTH "\08" - END - - STRINGTABLE DISCARDABLE diff --git a/nix/nixcrpkgs/pkgs/usbview/my_xmlhelper.c b/nix/nixcrpkgs/pkgs/usbview/my_xmlhelper.c deleted file mode 100644 index 0cdf29140b..0000000000 --- a/nix/nixcrpkgs/pkgs/usbview/my_xmlhelper.c +++ /dev/null @@ -1,47 +0,0 @@ -#include "xmlhelper.h" - -EXTERN_C HRESULT InitXmlHelper() -{ - return 0; -} - -EXTERN_C HRESULT ReleaseXmlWriter() -{ - return 0; -} - -EXTERN_C HRESULT SaveXml(LPTSTR szfileName, DWORD dwCreationDisposition) -{ - MessageBox(NULL, - "Sorry, XML saving is not supported in this build.", - "XML not supported", - MB_OK | MB_ICONEXCLAMATION); - return 0; -} - -EXTERN_C HRESULT XmlAddHostController( - PSTR hcName, - PUSBHOSTCONTROLLERINFO hcInfo - ) -{ - return 0; -} - -EXTERN_C HRESULT XmlAddRootHub(PSTR rhName, PUSBROOTHUBINFO rhInfo) -{ - return 0; -} - -EXTERN_C HRESULT XmlAddExternalHub(PSTR ehName, PUSBEXTERNALHUBINFO ehInfo) -{ - return 0; -} - -EXTERN_C HRESULT XmlAddUsbDevice(PSTR devName, PUSBDEVICEINFO deviceInfo) -{ - return 0; -} - -EXTERN_C VOID XmlNotifyEndOfNodeList(PVOID pContext) -{ -} diff --git a/nix/nixcrpkgs/pkgs/xcb-proto/builder.sh b/nix/nixcrpkgs/pkgs/xcb-proto/builder.sh deleted file mode 100644 index e83c5bbb34..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-proto/builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -ls -mv xcb-proto-* xcb-proto - -mkdir build -cd build - -../xcb-proto/configure --prefix=$out - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/xcb-proto/default.nix b/nix/nixcrpkgs/pkgs/xcb-proto/default.nix deleted file mode 100644 index b9cdc0b1fc..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-proto/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ crossenv }: - -let - version = "1.12"; - - name = "xcb-proto-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xcb.freedesktop.org/dist/xcb-proto-${version}.tar.bz2"; - sha256 = "01j91946q8f34l1mbvmmgvyc393sm28ym4lxlacpiav4qsjan8jr"; - }; - - lib = crossenv.native.make_derivation rec { - inherit version name src; - builder = ./builder.sh; - native_inputs = [ crossenv.nixpkgs.python2 ]; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xcb-proto/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-proto/license_builder.sh deleted file mode 100644 index 2ea7114353..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-proto/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-proto-* xcb-proto - -license=$(cat xcb-proto/COPYING) - -cat > $out <xcb-proto - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/xcb-util-image/default.nix b/nix/nixcrpkgs/pkgs/xcb-util-image/default.nix deleted file mode 100644 index 14a5b54583..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-image/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ crossenv, libxcb, xcb-util }: - -let - version = "0.4.0"; - - name = "xcb-util-image-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xcb.freedesktop.org/dist/xcb-util-image-${version}.tar.bz2"; - sha256 = "1z1gxacg7q4cw6jrd26gvi5y04npsyavblcdad1xccc8swvnmf9d"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - builder = ./util_image_builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ libxcb xcb-util ]; - - inherit libxcb; - libxcb_util = xcb-util; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - libxcb.license_set // - xcb-util.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xcb-util-image/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-image/license_builder.sh deleted file mode 100644 index 9cc75651e6..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-image/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-util-image-* xcb-util-image - -license=$(cat xcb-util-image/COPYING) - -cat > $out <xcb-util-image - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/xcb-util-image/util_image_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-image/util_image_builder.sh deleted file mode 100644 index 3b5d1e6cf3..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-image/util_image_builder.sh +++ /dev/null @@ -1,20 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-* util - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../util/configure --prefix=$out $configure_flags - -make - -make install - -# xcb-util-image-0.4.0/image/xcb_image.c includes -echo "Requires: xcb-aux" >> $out/lib/pkgconfig/xcb-image.pc -ln -sf $libxcb/lib/pkgconfig/*.pc $out/lib/pkgconfig/ -ln -sf $libxcb_util/lib/pkgconfig/*.pc $out/lib/pkgconfig/ - diff --git a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/default.nix b/nix/nixcrpkgs/pkgs/xcb-util-keysyms/default.nix deleted file mode 100644 index 6d5b8298f0..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ crossenv, libxcb }: - -let - version = "0.4.0"; - - name = "xcb-util-keysyms"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xcb.freedesktop.org/dist/xcb-util-keysyms-${version}.tar.bz2"; - sha256 = "1nbd45pzc1wm6v5drr5338j4nicbgxa5hcakvsvm5pnyy47lky0f"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - - builder = ./util_keysyms_builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ libxcb ]; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - libxcb.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-keysyms/license_builder.sh deleted file mode 100644 index 66175097fa..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-util-keysyms-* xcb-util-keysyms - -license=$(head -n31 xcb-util-keysyms/keysyms/keysyms.c) - -cat > $out <xcb-util-keysyms - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/util_keysyms_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-keysyms/util_keysyms_builder.sh deleted file mode 100644 index eaa8982251..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-keysyms/util_keysyms_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-* util - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../util/configure --prefix=$out $configure_flags - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/default.nix b/nix/nixcrpkgs/pkgs/xcb-util-renderutil/default.nix deleted file mode 100644 index f20b271e31..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ crossenv, libxcb }: - -let - version = "0.3.9"; - - name = "xcb-util-renderutil"; # TODO: add -${version} (mass rebuild) - - src = crossenv.nixpkgs.fetchurl { - url = "https://xcb.freedesktop.org/dist/xcb-util-renderutil-${version}.tar.bz2"; - sha256 = "0nza1csdvvxbmk8vgv8vpmq7q8h05xrw3cfx9lwxd1hjzd47xsf6"; - }; - - lib = crossenv.make_derivation { - inherit version name src; - - # TODO: rename all xcb-util builders to builder.sh (mass rebuild) - builder = ./util_renderutil_builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ libxcb ]; - - xcb = libxcb; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - libxcb.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-renderutil/license_builder.sh deleted file mode 100644 index 96f60bcf96..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-util-renderutil-* xcb-util-renderutil - -license=$(cat xcb-util-renderutil/COPYING) - -cat > $out <xcb-util-renderutil - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/util_renderutil_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-renderutil/util_renderutil_builder.sh deleted file mode 100644 index 4540eae4cb..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-renderutil/util_renderutil_builder.sh +++ /dev/null @@ -1,16 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-* util - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../util/configure --prefix=$out $configure_flags - -make - -make install - -ln -s $xcb/lib/pkgconfig/{xcb,xcb-render}.pc $out/lib/pkgconfig/ diff --git a/nix/nixcrpkgs/pkgs/xcb-util-wm/default.nix b/nix/nixcrpkgs/pkgs/xcb-util-wm/default.nix deleted file mode 100644 index 1390a4abdf..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-wm/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ crossenv, libxcb }: - -let - version = "0.4.1"; - - name = "xcb-util-wm-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xcb.freedesktop.org/dist/xcb-util-wm-${version}.tar.bz2"; - sha256 = "0gra7hfyxajic4mjd63cpqvd20si53j1q3rbdlkqkahfciwq3gr8"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - - builder = ./util_wm_builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ libxcb ]; - - native_inputs = [ crossenv.nixpkgs.m4 ]; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - libxcb.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xcb-util-wm/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-wm/license_builder.sh deleted file mode 100644 index adbaa5ed50..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-wm/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-util-wm-* xcb-util-wm - -license=$(cat xcb-util-wm/COPYING) - -cat > $out <xcb-util-wm - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/xcb-util-wm/util_wm_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util-wm/util_wm_builder.sh deleted file mode 100644 index eaa8982251..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util-wm/util_wm_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-* util - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../util/configure --prefix=$out $configure_flags - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/xcb-util/default.nix b/nix/nixcrpkgs/pkgs/xcb-util/default.nix deleted file mode 100644 index 48cadb58d1..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ crossenv, libxcb }: - -let - version = "0.4.0"; - - name = "xcb-util-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xcb.freedesktop.org/dist/xcb-util-${version}.tar.bz2"; - sha256 = "1sahmrgbpyki4bb72hxym0zvxwnycmswsxiisgqlln9vrdlr9r26"; - }; - - lib = crossenv.make_derivation rec { - inherit version name src; - - builder = ./util_builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ libxcb ]; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = - libxcb.license_set // - { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xcb-util/license_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util/license_builder.sh deleted file mode 100644 index 7d65ade3bd..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-util-* xcb-util - -license=$(cat xcb-util/COPYING) - -cat > $out <xcb-util - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/xcb-util/util_builder.sh b/nix/nixcrpkgs/pkgs/xcb-util/util_builder.sh deleted file mode 100644 index 6264407a65..0000000000 --- a/nix/nixcrpkgs/pkgs/xcb-util/util_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xcb-util-* util - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../util/configure --prefix=$out $configure_flags - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/xextproto/builder.sh b/nix/nixcrpkgs/pkgs/xextproto/builder.sh deleted file mode 100644 index 6bf1c02c59..0000000000 --- a/nix/nixcrpkgs/pkgs/xextproto/builder.sh +++ /dev/null @@ -1,13 +0,0 @@ -source $setup - -tar -xf $src -mv xextproto-* xextproto - -mkdir build -cd build - -../xextproto/configure --prefix=$out - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/xextproto/default.nix b/nix/nixcrpkgs/pkgs/xextproto/default.nix deleted file mode 100644 index 82b0a626ec..0000000000 --- a/nix/nixcrpkgs/pkgs/xextproto/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ crossenv }: - -let - version = "7.3.0"; - - name = "xextproto-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xorg.freedesktop.org/releases/individual/proto/xextproto-${version}.tar.bz2"; - sha256 = "1c2vma9gqgc2v06rfxdiqgwhxmzk2cbmknwf1ng3m76vr0xb5x7k"; - }; - - lib = crossenv.native.make_derivation rec { - inherit version name src; - builder = ./builder.sh; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xextproto/license_builder.sh b/nix/nixcrpkgs/pkgs/xextproto/license_builder.sh deleted file mode 100644 index 9fbf3543d3..0000000000 --- a/nix/nixcrpkgs/pkgs/xextproto/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xextproto-* xextproto - -license=$(cat xextproto/COPYING) - -cat > $out <xextproto - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/xorg-macros/builder.sh b/nix/nixcrpkgs/pkgs/xorg-macros/builder.sh deleted file mode 100644 index f940d965f1..0000000000 --- a/nix/nixcrpkgs/pkgs/xorg-macros/builder.sh +++ /dev/null @@ -1,18 +0,0 @@ -source $setup - -tar -xf $src -ls -mv util-macros-* macros - -mkdir build -cd build - -../macros/configure --prefix=$out - -make - -make install - -# The .pc files gets installed to /share/pkgconfig, but we want to see it in -# /lib/pkgconfig. -ln -s share $out/lib diff --git a/nix/nixcrpkgs/pkgs/xorg-macros/default.nix b/nix/nixcrpkgs/pkgs/xorg-macros/default.nix deleted file mode 100644 index 2f5c8508f9..0000000000 --- a/nix/nixcrpkgs/pkgs/xorg-macros/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ crossenv }: - -let - version = "1.19.1"; - - name = "xorg-macros-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://www.x.org/releases/individual/util/util-macros-1.19.1.tar.gz"; - sha256 = "1f27cmbxq0kdyvqsplxpsi9pxm5qy45lcagxr9gby2hy3pjd0aj7"; - }; - - lib = crossenv.native.make_derivation { - inherit version name src; - builder = ./builder.sh; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xorg-macros/license_builder.sh b/nix/nixcrpkgs/pkgs/xorg-macros/license_builder.sh deleted file mode 100644 index fb723a09de..0000000000 --- a/nix/nixcrpkgs/pkgs/xorg-macros/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv util-macros-* xorg-macros - -license=$(cat xorg-macros/COPYING) - -cat > $out <xorg-macros - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/xproto/builder.sh b/nix/nixcrpkgs/pkgs/xproto/builder.sh deleted file mode 100644 index 7f6b13edbd..0000000000 --- a/nix/nixcrpkgs/pkgs/xproto/builder.sh +++ /dev/null @@ -1,16 +0,0 @@ -source $setup - -tar -xf $src -mv xproto-* xproto - -cp $gnu_config/{config.guess,config.sub} xproto - -mkdir build -cd build - -PKG_CONFIG=pkg-config-cross \ -../xproto/configure --prefix=$out $configure_flags - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/xproto/default.nix b/nix/nixcrpkgs/pkgs/xproto/default.nix deleted file mode 100644 index 6b16b0b4ec..0000000000 --- a/nix/nixcrpkgs/pkgs/xproto/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ crossenv, xorg-macros }: - -let - version = "7.0.31"; - - name = "xproto-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://www.x.org/releases/individual/proto/xproto-${version}.tar.gz"; - sha256 = "1is3xl0zjk4l0d8d0zinkfbfapgdby2i56jjfp6caibvwam5wxbd"; - }; - - lib = crossenv.make_derivation { - inherit version name src; - - builder = ./builder.sh; - - configure_flags = - "--host=${crossenv.host} " + - "--enable-static " + - "--disable-shared"; - - cross_inputs = [ xorg-macros ]; - - # Need the latest version of config.sub so we can support musl. - gnu_config = crossenv.native.gnu_config; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = xorg-macros.license_set // { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xproto/license_builder.sh b/nix/nixcrpkgs/pkgs/xproto/license_builder.sh deleted file mode 100644 index 4ed0509f16..0000000000 --- a/nix/nixcrpkgs/pkgs/xproto/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xproto-* xproto - -license=$(cat xproto/COPYING) - -cat > $out <xproto - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/xtrans/builder.sh b/nix/nixcrpkgs/pkgs/xtrans/builder.sh deleted file mode 100644 index 354670cb0a..0000000000 --- a/nix/nixcrpkgs/pkgs/xtrans/builder.sh +++ /dev/null @@ -1,16 +0,0 @@ -source $setup - -tar -xf $src -mv xtrans-* xtrans - -mkdir build -cd build - -../xtrans/configure --prefix $out - -make - -make install - -# So we can find the pkgconfig files in lib/pkgconfig -ln -s share $out/lib diff --git a/nix/nixcrpkgs/pkgs/xtrans/default.nix b/nix/nixcrpkgs/pkgs/xtrans/default.nix deleted file mode 100644 index 44daf818ac..0000000000 --- a/nix/nixcrpkgs/pkgs/xtrans/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ crossenv }: - -let - version = "1.3.5"; - - name = "xtrans-${version}"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://xorg.freedesktop.org/releases/individual/lib/xtrans-${version}.tar.bz2"; - sha256 = "00c3ph17acnsch3gbdmx33b9ifjnl5w7vx8hrmic1r1cjcv3pgdd"; - }; - - lib = crossenv.native.make_derivation rec { - inherit version name src; - builder = ./builder.sh; - }; - - license = crossenv.native.make_derivation { - name = "${name}-license"; - inherit src; - builder = ./license_builder.sh; - }; - - license_set = { "${name}" = license; }; - -in - lib // { inherit license_set; } diff --git a/nix/nixcrpkgs/pkgs/xtrans/license_builder.sh b/nix/nixcrpkgs/pkgs/xtrans/license_builder.sh deleted file mode 100644 index 0b43e8b786..0000000000 --- a/nix/nixcrpkgs/pkgs/xtrans/license_builder.sh +++ /dev/null @@ -1,14 +0,0 @@ -source $setup - -tar -xf $src -mv xtrans-* xtrans - -license=$(cat xtrans/COPYING) - -cat > $out <xtrans - -
-$license
-
-EOF diff --git a/nix/nixcrpkgs/pkgs/zlib/builder.sh b/nix/nixcrpkgs/pkgs/zlib/builder.sh deleted file mode 100644 index b7906b5a2e..0000000000 --- a/nix/nixcrpkgs/pkgs/zlib/builder.sh +++ /dev/null @@ -1,15 +0,0 @@ -source $setup - -tar -xf $src - -mkdir build -cd build - -sed -i 's$Darwin. | darwin.$Ignore* | ignore*$' ../zlib-$version/configure - -CHOST=$host \ -../zlib-$version/configure --prefix=$out --static - -make - -make install diff --git a/nix/nixcrpkgs/pkgs/zlib/default.nix b/nix/nixcrpkgs/pkgs/zlib/default.nix deleted file mode 100644 index 11242407ac..0000000000 --- a/nix/nixcrpkgs/pkgs/zlib/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ crossenv }: - -crossenv.make_derivation rec { - name = "zlib-${version}"; - - version = "1.2.11"; - - src = crossenv.nixpkgs.fetchurl { - url = "https://zlib.net/zlib-${version}.tar.gz"; - sha256 = "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"; - }; - - builder = ./builder.sh; -} diff --git a/nix/nixcrpkgs/pretend_stdenv/setup b/nix/nixcrpkgs/pretend_stdenv/setup deleted file mode 100644 index a0f3af7009..0000000000 --- a/nix/nixcrpkgs/pretend_stdenv/setup +++ /dev/null @@ -1 +0,0 @@ -export PATH=$_PATH diff --git a/nix/nixcrpkgs/support/derivations.txt b/nix/nixcrpkgs/support/derivations.txt deleted file mode 100644 index d5d9f09afa..0000000000 --- a/nix/nixcrpkgs/support/derivations.txt +++ /dev/null @@ -1,58 +0,0 @@ -define all = win32,win64,linux32,linux64,linux-rpi,mac -define windows = win32,win64 -define linux = linux32,linux64,linux-rpi - -# Cross-compiler toolchains -{$windows,$linux}.gcc slow=1 -mac.toolchain slow=1 - -# Packages -{$windows}.angle{,.examples} slow=1 -{$windows}.angle.examples -omni.at-spi2-headers -{$all}.avrdude -omni.dejavu-fonts -{$windows}.devcon -{$all}.expat -omni.fixesproto -{$windows}.gdb -{$all}.hello -{$all}.hello_cpp -omni.inputproto -{$all}.ion -omni.kbproto -{$linux}.libudev -{$all}.libusb -{$all}.libusbp{,.examples} -{$linux}.libx11 -{$linux}.libxall -{$all}.libxau -{$all}.libxcb{,.examples} -{$linux}.libxext -{$linux}.libxfixes -{$linux}.libxi -{$all}.openocd -{$all}.pavr2 -{$windows}.pdcurses{,.examples} -{$all}.p-load -{$all}.qt slow=1 -{$all}.qt.examples -{$windows}.readline -{$all}.tic -{$windows}.usbview -omni.xcb-proto -{$all}.xcb-util -{$all}.xcb-util-image -{$all}.xcb-util-keysyms -{$all}.xcb-util-renderutil -{$all}.xcb-util-wm -omni.xextproto -omni.xorg-macros -{$all}.xproto -omni.xtrans -{$all}.zlib - -# Derivations we care about at Pololu -{win32,linux32,linux-rpi,mac}.{p-load,pavr2,tic} priority=1 - -# TODO: Test building the license_sets somehow too. diff --git a/nix/nixcrpkgs/support/expand_brackets.rb b/nix/nixcrpkgs/support/expand_brackets.rb deleted file mode 100644 index fccee45104..0000000000 --- a/nix/nixcrpkgs/support/expand_brackets.rb +++ /dev/null @@ -1,43 +0,0 @@ -def expand_brackets_core(str, depth) - finished_parts = [] - active_parts = [+''] - while true - if str.empty? - raise AnticipatedError, "Unmatched opening brace" if depth > 0 - break - elsif str.start_with?('}') - str.slice!(0) - raise AnticipatedError, "Unmatched closing brace" if depth == 0 - break - elsif str.start_with?('{') - # Recurse, which removes everything up to and - # including the matching closing brace. - str.slice!(0) - options = expand_brackets_core(str, depth + 1) - raise if options.empty? - active_parts = active_parts.flat_map { |p1| - options.map { |p2| p1 + p2 } - } - elsif str.start_with?(',') - raise AnticipatedError, "Comma at top level" if depth == 0 - # Remove the comma, mark the parts we are working - # on as finished, and start a new part. - str.slice!(0) - finished_parts += active_parts - active_parts = [''] - else - part_length = str.index(/[{},]|$/) - raise if part_length < 1 - part = str.slice!(0, part_length) - active_parts.each do |s| - s.insert(-1, part) - end - end - end - finished_parts + active_parts -end - -# Expands something like "{a,b}{,.x}" to ["a", "a.x", "b", "b.x"] -def expand_brackets(str) - expand_brackets_core(str.dup, 0) -end diff --git a/nix/nixcrpkgs/support/graph.rb b/nix/nixcrpkgs/support/graph.rb deleted file mode 100644 index b1db811371..0000000000 --- a/nix/nixcrpkgs/support/graph.rb +++ /dev/null @@ -1,74 +0,0 @@ -def print_graph(graph) - graph.each do |parent, children| - puts "#{parent} ->" - children.each do |child| - puts " #{child}" - end - end -end - -def check_graph!(graph) - graph.each do |parent, children| - children.each do |child| - if !graph.key?(child) - raise "Graph is missing an entry for #{child}" - end - end - end -end - -def depth_first_search_exclude_start(graph, start) - stack = [graph.fetch(start).to_a.reverse] - visited = Set.new - until stack.empty? - node = stack.last.pop - if node.nil? - stack.pop - next - end - next if visited.include?(node) - visited << node - stack << graph.fetch(node).to_a.reverse - yield node - end -end - -def transitive_closure(graph) - tc = {} - graph.each_key do |node| - tc[node] = enum_for(:depth_first_search_exclude_start, graph, node).to_a - end - tc -end - -def restricted_transitive_closure(graph, allowed) - rtc = {} - graph.each_key do |node| - next if !allowed.include?(node) - reached_nodes = [] - depth_first_search_exclude_start(graph, node) do |reached_node| - next if !allowed.include?(reached_node) - reached_nodes << reached_node - end - rtc[node] = reached_nodes - end - rtc -end - -def transitive_reduction(graph) - tr = {} - graph.each do |start_node, nodes| - nodes_with_max_distance_1 = Set.new(nodes) - distance = 1 - until nodes.empty? - nodes = Set.new nodes.flat_map &graph.method(:fetch) - nodes_with_max_distance_1 -= nodes - distance += 1 - if distance > graph.size - raise "Cycle detected: this algorithm only works with DAGs." - end - end - tr[start_node] = nodes_with_max_distance_1.to_a - end - tr -end diff --git a/nix/nixcrpkgs/support/manage b/nix/nixcrpkgs/support/manage deleted file mode 100755 index a21f3ec9f8..0000000000 --- a/nix/nixcrpkgs/support/manage +++ /dev/null @@ -1,541 +0,0 @@ -#!/usr/bin/env ruby - -# This part of hte code is under construction. It will eventually be a script that -# helps us check that the derivations we care about are all building, -# and prints the status of those builds. - - -# This requires Ruby 2.5.0 or later because it uses a new syntax for rescuing -# exceptions in a block with needing to make an extra begin/end pair. - -require 'open3' -require 'pathname' -require 'set' -require 'sqlite3' # gem install sqlite3 -require_relative 'graph' -require_relative 'expand_brackets' - -ResultsDir = Pathname('support/results') - -class AnticipatedError < RuntimeError -end - -# Don't automatically change directory because maybe people want to test one -# nixcrpkgs repository using the test script from another one. But do give an -# early, friendly warning if they are running in the wrong directory. -def check_directory! - return if File.directory?('pretend_stdenv') - $stderr.puts "You should run this script from the nixcrpkgs directory." - dir = Pathname(__FILE__).parent.parent - $stderr.puts "Try running these commands:\n cd #{dir}\n test/test.rb" - exit 1 -end - -def substitute_definitions(defs, str) - str.gsub(/\$([\w-]+)/) do |x| - defs.fetch($1) - end -end - -def parse_derivation_list(filename) - defs = {} - all_paths = Set.new - all_attrs = {} - File.foreach(filename).with_index do |line, line_index| - line.strip! - - # Handle empty lines and comments. - next if line.empty? || line.start_with?('#') - - # Handle variable definitions (e.g. "define windows = win32,win64"). - if line.start_with?('define') - md = line.match(/^define\s+([\w-]+)\s*=\s*(.*)$/) - if !md - raise AnticipatedError, "Invalid definition syntax." - end - name, value = md[1], md[2] - defs[name] = value - next - end - - # Expand variable definitions (e.g. $windows expands to "win32,win64"). - line = substitute_definitions(defs, line) - - # Figure out which parts of the line are attribute paths with brackets and - # which are attributes. - items = line.split(' ') - attr_defs, path_items = items.partition { |p| p.include?('=') } - - # Expand any brackets in the attribute paths to get the complete list of - # paths specified on this line. - paths = path_items.flat_map { |p| expand_brackets(p) }.map(&:to_sym) - - # Process attribute definitions on the line, like "priority=1". - attrs = {} - attr_defs.each do |attr_def| - md = attr_def.match(/^(\w+)=(\d+)$/) - if !md - raise AnticipatedError, "Invalid attribute definition: #{attr_def.inspect}." - end - name, value = md[1], md[2] - case name - when 'priority', 'slow' - attrs[name.to_sym] = value.to_i - else - raise AnticipatedError, "Unrecognized attribute: #{name.inspect}." - end - end - - # Record the paths for this line and the attributes for those paths, - # overriding previous attributes values if necessary. - all_paths += paths - if !attrs.empty? - paths.each do |path| - (all_attrs[path] ||= {}).merge!(attrs) - end - end - rescue AnticipatedError => e - raise AnticipatedError, "#{filename}:#{line_index + 1}: error: #{e}" - end - - if all_paths.empty? - raise AnticipatedError, "#{filename} specifies no paths" - end - - all_paths.each do |path| - if !path.match?(/^[\w.-]+$/) - raise "Invalid characters in path name: #{path}" - end - end - - { defs: defs, paths: all_paths.to_a, attrs: all_attrs } -end - -# Make a hash holding the priority of each Nix attribute path we want to build. -# This routine determines the default priority. -def make_path_priority_map(settings) - attrs = settings.fetch(:attrs) - m = {} - settings.fetch(:paths).each do |path| - m[path] = attrs.fetch(path, {}).fetch(:priority, 0) - end - m -end - -# Make a hash holding the relative build time of each Nix attribute path we want -# to build. This routine detrmines the default time, and what "slow" means. -def make_path_time_map(settings) - attrs = settings.fetch(:attrs) - m = {} - settings.fetch(:paths).each do |path| - m[path] = attrs.fetch(path, {})[:slow] ? 100 : 1 - end - m -end - -def instantiate_drvs(paths) - cmd = 'nix-instantiate ' + paths.map { |p| "-A #{p}" }.join(' ') - stdout_str, stderr_str, status = Open3.capture3(cmd) - if !status.success? - $stderr.puts stderr_str - raise AnticipatedError, "Failed to instantiate derivations." - end - paths.zip(stdout_str.split.map(&:to_sym)).to_h -end - -# We want there to be a one-to-one mapping between paths in the derivations.txt -# list and derivations, so we can make a graph of dependencies of the -# derivations and each derivation in the graph will have a unique path in the -# derivations.txt list. -def check_paths_are_unique!(path_drv_map) - set = Set.new - path_drv_map.each do |key, drv| - if set.include?(drv) - raise AnticipatedError, "The derivation #{key} is the same as " \ - "other derivations in the list. Maybe use the 'omni' namespace." - end - set << drv - end -end - -# Makes a new map that has the same keys as map1, and the values -# have all been mapped by map2. -# -# Requires map2 to have a key for every value in map1. -def map_compose(map1, map2) - map1.transform_values &map2.method(:fetch) -end - -# Like map_compose, but excludes keys from map1 where the corresponding map1 -# value is not a key of map2. -def map_join(map1, map2) - r = {} - map1.each do |key, value| - if map2.key?(value) - r[key] = map2.fetch(value) - end - end - r -end - -def nix_db - return $db if $db - $db = SQLite3::Database.new '/nix/var/nix/db/db.sqlite', readonly: true -end - -# Given an array of derivations (paths to .drv files in /nix), this function -# queries the Nix database and returns hash table mapping derivations to -# a boolean that is true if they have already been built. -def get_build_status(drvs) - drv_list_str = drvs.map { |d| "\"#{d}\"" }.join(", ") - query = < 0 - more_attrs << " penwidth=3" - end - - # Draw slow nodes as a double octagon. - if path_time_map.fetch(path) > 10 - more_attrs << " shape=doubleoctagon" - end - f.puts "\"#{path}\" [label=\"#{component}\"#{more_attrs}]" - end - f.puts "}" - end - - # Output dependencies between nodes. - visible_paths.each do |path| - path_graph.fetch(path).each do |dep| - next if decompose.(dep).first == 'omni' - f.puts "\"#{path}\" -> \"#{dep}\"" - end - end - f.puts "}" - end -end - -def make_build_plan(path_state) - path_graph = path_state.fetch(:graph) - path_priority_map = path_state.fetch(:priority_map) - path_time_map = path_state.fetch(:time_map) - path_built_map = path_state.fetch(:built_map) - - # It's handy to be able to get all the dependencies of a node in one step, and - # we will use that frequently to calculate how expensive it is to build a - # node and to make the toplogical sort. - path_graph = transitive_closure(path_graph).freeze - - # The paths we need to build. In the future we could filter this by priority. - required_paths = Set.new(path_graph.keys).freeze - - # built_paths: The set of paths that are already built. We will mutate this - # as we simulate our build plan. - built_paths = Set.new - path_built_map.each do |path, built| - built_paths << path if built - end - - # List of paths to build. Each path should only be built once all the paths it - # depends on are built. I know nix-build can take care of that for us, but it's - # nice to see the precise order of what is going to be built so we can tell when - # slow things will get built. - build_plan = [] - - # Computes the time to build a path, taking into account what has already been - # built. - calculate_time = lambda do |path| - deps = path_graph.fetch(path) + [path] - deps.reject! &built_paths.method(:include?) - deps.map(&path_time_map.method(:fetch)).sum - end - - # Adds plans to build this path and all of its unbuilt depedencies. - add_to_build_plan = lambda do |path| - deps = path_graph.fetch(path) + [path] - - # Remove dependencies that are already built. - deps.reject! &built_paths.method(:include?) - - # Topological sort - deps.sort! do |p1, p2| - case - when path_graph.fetch(p1).include?(p2) then 1 - when path_graph.fetch(p2).include?(p1) then -1 - else 0 - end - end - - deps.each do |path| - build_plan << path - built_paths << path - end - end - - while true - unbuilt_required_paths = required_paths - built_paths - break if unbuilt_required_paths.empty? - - # Find the maximum priority of the unbuilt required paths. - max_priority = nil - unbuilt_required_paths.each do |path| - priority = path_priority_map.fetch(path) - if !max_priority || priority > max_priority - max_priority = priority - end - end - - top_priority_paths = unbuilt_required_paths.select do |path| - path_priority_map.fetch(path) == max_priority - end - - target = top_priority_paths.min_by(&calculate_time) - - add_to_build_plan.(target) - end - - build_plan -end - -# Updates the 'support/results' directory, which holds -# symbolic links to all the derivations defined by nixcrpkgs and -# listed in support/derivations.txt which have already been built. -# -# Intended use: -# ln -s $PWD/support/results /nix/var/nix/gcroots/nixcrpkgs-results -# support/manage results -# nix-collect-garbage -def update_results_dir(path_valid_results_map) - ResultsDir.mkdir if !ResultsDir.directory? - ResultsDir.children.each do |p| - p.unlink - end - modern_links = Set.new - path_valid_results_map.each do |path, results_map| - results_map.each do |id, result| - suffix = id == :out ? '' : ".#{id}" - link_name = "#{path}#{suffix}" - (ResultsDir + link_name).make_symlink(result) - modern_links << link_name - end - end -end - -def build_paths(path_graph, path_built_map, build_plan, keep_going: true) - path_built_map = path_built_map.dup - path_graph = transitive_closure(path_graph) - build_plan.each do |path| - if !path_graph.fetch(path).all?(&path_built_map.method(:fetch)) - # One of the dependencies of this path has not been built, presumably - # because there was an error. - puts "# skipping #{path}" - next - end - - print "nix-build -A #{path}" - system("nix-build -A #{path} > /dev/null 2> /dev/null") - - if $?.success? - path_built_map[path] = true - puts - else - puts " # failed" - return false if !keep_going - end - end - true -end - -def parse_args(argv) - action = case argv.first - when 'graph' then :graph - when 'results' then :results - when 'build' then :build - when 'plan' then :plan - when 'stats', nil then :stats - else raise AnticipatedError, "Invalid action: #{argv.first.inspect}" - end - - { action: action } -end - -begin - check_directory! - args = parse_args(ARGV) - action = args.fetch(:action) - - settings = parse_derivation_list('support/derivations.txt') - - path_drv_map = instantiate_drvs(settings.fetch(:paths)) - check_paths_are_unique!(path_drv_map) - - drvs = path_drv_map.values.uniq - drv_built_map = get_build_status(drvs) - - if [:graph, :build, :plan].include?(action) - global_drv_graph = get_drv_graph - drv_graph = graph_restrict_nodes(global_drv_graph, drvs) - path_state = { - graph: graph_unmap(drv_graph, path_drv_map).freeze, - priority_map: make_path_priority_map(settings).freeze, - time_map: make_path_time_map(settings).freeze, - built_map: map_compose(path_drv_map, drv_built_map).freeze, - }.freeze - end - - if action == :graph - output_graphviz(path_state) - end - - if [:build, :plan].include?(action) - build_plan = make_build_plan(path_state) - end - - if action == :plan - puts "Build plan:" - build_plan.each do |path| - puts "nix-build -A #{path}" - end - end - - if action == :build - success = build_paths(path_state[:graph], path_state[:built_map], build_plan) - exit(1) if !success - end - - if action == :results || action == :build - drv_valid_results_map = get_valid_results(drvs) - path_valid_results_map = map_join(path_drv_map, drv_valid_results_map).freeze - update_results_dir(path_valid_results_map) - end - - if action == :stats - print_stats(drv_built_map) - end -rescue AnticipatedError => e - $stderr.puts e -end diff --git a/nix/nixcrpkgs/top.nix b/nix/nixcrpkgs/top.nix deleted file mode 100644 index 5e1aa63a65..0000000000 --- a/nix/nixcrpkgs/top.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ osx_sdk, nixpkgs }: - -rec { - inherit nixpkgs; - - # Some native build tools. - native = import ./native { inherit nixpkgs; }; - - # Cross-compiling environments for each target system. - crossenvs = { - i686-w64-mingw32 = import ./mingw-w64 { inherit native; arch = "i686"; }; - x86_64-w64-mingw32 = import ./mingw-w64 { inherit native; arch = "x86_64"; }; - i686-linux-musl = import ./linux { inherit native; arch = "i686"; }; - x86_64-linux-musl = import ./linux { inherit native; arch = "x86_64"; }; - armv6-linux-musl = import ./linux { - inherit native; - arch = "armv6"; - gcc_options = "--with-fpu=vfp --with-float=hard "; - }; - macos = import ./macos { inherit osx_sdk native; }; - }; - - pkgFun = crossenv: import ./pkgs.nix { inherit crossenv; } // crossenv; - - # Sets of packages for each target system. - i686-w64-mingw32 = pkgFun crossenvs.i686-w64-mingw32; - x86_64-w64-mingw32 = pkgFun crossenvs.x86_64-w64-mingw32; - i686-linux-musl = pkgFun crossenvs.i686-linux-musl; - x86_64-linux-musl = pkgFun crossenvs.x86_64-linux-musl; - armv6-linux-musl = pkgFun crossenvs.armv6-linux-musl; - macos = pkgFun crossenvs.macos; - - # omni is convenient name for packages that are used for cross-compiling but - # are actually the same on all platforms. You can just refer to it by - # 'omni.package_name' instead of 'some_platform.package_name'. - omni = pkgFun { inherit native nixpkgs; }; - - # Handy aliases. - win32 = i686-w64-mingw32; - win64 = x86_64-w64-mingw32; - linux32 = i686-linux-musl; - linux-x86 = i686-linux-musl; - linux-i686 = i686-linux-musl; - linux64 = x86_64-linux-musl; - linux-x86_64 = x86_64-linux-musl; - linux-rpi = armv6-linux-musl; - rpi = armv6-linux-musl; - mac = macos; - - # filter is a function that can be applied to a local directory to filter out - # files that are likely to change frequently without affecting the build, - # causing unneeded rebuilds. - filter_func = name: type: let bn = baseNameOf (toString name); in !( - (type == "directory" && bn == ".git") || - (type == "symlink" && nixpkgs.lib.hasPrefix "result" bn) || - (type == "directory" && bn == "nix") || - (type == "directory" && bn == "build") || - nixpkgs.lib.hasSuffix ".nix" bn || - nixpkgs.lib.hasSuffix "~" bn - ); - filter = builtins.filterSource filter_func; - - # bundle is a function that takes a set of derivations and makes a - # derivation for a bundle that has symbolic links in it to each of - # the input derivations. - bundle = drvs: native.make_derivation rec { - name = "bundle"; - builder = ./bundle_builder.sh; - names = builtins.attrNames drvs; - dirs = builtins.attrValues drvs; - }; -} diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix deleted file mode 100644 index fd2d2cd4a4..0000000000 --- a/nix/nixpkgs.nix +++ /dev/null @@ -1,13 +0,0 @@ -let - - rev = "61c3169a0e17d789c566d5b241bfe309ce4a6275"; - hash = "0qbycg7wkb71v20rchlkafrjfpbk2fnlvvbh3ai9pyfisci5wxvq"; - pkgs = builtins.fetchTarball { - name = "nixpkgs-2019-01-15"; - url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz"; - sha256 = hash; - }; - -in - -import pkgs {} diff --git a/nix/ops/boot-ship.nix b/nix/ops/boot-ship.nix deleted file mode 100644 index b54a7a90ae..0000000000 --- a/nix/ops/boot-ship.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs ? import ../nixpkgs.nix -, debug ? false -, ship ? "zod" -, pill ? ../../bin/solid.pill -}: - -let - - deps = import ../deps { inherit pkgs; }; - tlon = import ../pkgs { inherit pkgs; }; - arvo = tlon.arvo; - urbit = tlon.urbit; - herb = tlon.herb; - -in - -import ./fakeship { - inherit pkgs arvo pill ship urbit herb; -} diff --git a/nix/ops/brass/builder.sh b/nix/ops/brass/builder.sh deleted file mode 100755 index 75f76e872b..0000000000 --- a/nix/ops/brass/builder.sh +++ /dev/null @@ -1,22 +0,0 @@ -source $stdenv/setup - -set -ex - -cp -r $PIER ./pier -chmod -R u+rw ./pier - -$URBIT -d ./pier - -cleanup () { - if [ -e ./pier/.vere.lock ] - then kill $(< ./pier/.vere.lock) || true; - fi -} - -trap cleanup EXIT - -herb ./pier -P brass.pill -d '+brass' - -mv brass.pill $out - -set +x diff --git a/nix/ops/brass/default.nix b/nix/ops/brass/default.nix deleted file mode 100644 index ea83c4ff7b..0000000000 --- a/nix/ops/brass/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, herb, urbit, pier, arvo }: - -pkgs.stdenv.mkDerivation rec { - name = "brass"; - builder = ./builder.sh; - buildInputs = [ herb pkgs.coreutils ]; - - URBIT = urbit.meta.exe; - PIER = pier; - ARVO = arvo; -} diff --git a/nix/ops/default.nix b/nix/ops/default.nix deleted file mode 100644 index d048d783ed..0000000000 --- a/nix/ops/default.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ pkgs ? import ../nixpkgs.nix, debug ? false }: - -let - - tlon = import ../pkgs { inherit pkgs; }; - arvo = tlon.arvo; - arvo-ropsten = tlon.arvo-ropsten; - herb = tlon.herb; - urbit = if debug then tlon.urbit-debug else tlon.urbit; - - bootbrass = ../../bin/brass.pill; - bootsolid = ../../bin/solid.pill; - - rawzod = import ./fakeship { - inherit pkgs herb urbit; - pill = bootsolid; - ship = "zod"; - arvo = null; - }; - - ropzod = import ./fakeship { - inherit pkgs herb urbit; - pill = bootsolid; - ship = "zod"; - arvo = arvo-ropsten; - }; - - zod = import ./fakeship { - inherit pkgs herb urbit arvo; - pill = bootsolid; - ship = "zod"; - }; - -in - -rec { - - bus = import ./fakeship { - inherit pkgs herb urbit arvo; - pill = bootsolid; - ship = "bus"; - }; - - test = import ./test { - inherit pkgs herb urbit; - ship = bus; - }; - - solid = import ./solid { - inherit pkgs herb urbit arvo; - pier = rawzod; - }; - - brass = import ./brass { - inherit pkgs herb urbit arvo; - pier = zod; - }; - - brass-ropsten = import ./brass { - inherit pkgs herb urbit; - arvo = arvo-ropsten; - pier = ropzod; - }; - - ivory = import ./ivory { - inherit pkgs herb urbit arvo; - pier = zod; - }; - - ivory-ropsten = import ./ivory { - inherit pkgs herb urbit; - arvo = arvo-ropsten; - pier = ropzod; - }; - - image = import ./image { - inherit pkgs herb urbit solid; - }; - - image-ropsten = import ./image { - inherit pkgs herb urbit; - brass = brass-ropsten; - ivory = ivory-ropsten; - }; - -} diff --git a/nix/ops/fakeship/builder.sh b/nix/ops/fakeship/builder.sh deleted file mode 100755 index 19ef10b87e..0000000000 --- a/nix/ops/fakeship/builder.sh +++ /dev/null @@ -1,26 +0,0 @@ -source $stdenv/setup - -set -ex - -if [ -z "$ARVO" ] -then - $URBIT -d -F $SHIP -B "$PILL" $out -else - $URBIT -d -F $SHIP -A "$ARVO" -B "$PILL" $out -fi - -check () { - [ 3 -eq "$(herb $out -d 3)" ] -} - -if check && sleep 10 && check -then - echo "Boot success." >&2 - herb $out -p hood -d '+hood/exit' || true -else - echo "Boot failure." >&2 - kill $(< $out/.vere.lock) || true - exit 1 -fi - -set +x diff --git a/nix/ops/fakeship/default.nix b/nix/ops/fakeship/default.nix deleted file mode 100644 index 8ebfa4a5e4..0000000000 --- a/nix/ops/fakeship/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, herb, urbit, pill, ship, arvo }: - -pkgs.stdenv.mkDerivation { - name = "fake" + ship; - builder = ./builder.sh; - buildInputs = [ herb ]; - URBIT = urbit.meta.exe; - ARVO = arvo; - PILL = pill; - SHIP = ship; -} diff --git a/nix/ops/image/default.nix b/nix/ops/image/default.nix deleted file mode 100644 index ecfc97d267..0000000000 --- a/nix/ops/image/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ pkgs -, herb -, urbit -, solid ? null -, brass ? null -, ivory ? null -}: - -let - link = pill: path: - if pill == null then "" - else "${pkgs.coreutils}/bin/ln -sf ${pill} ${path}"; - -in pkgs.dockerTools.buildImage { - name = urbit.meta.name; - - runAsRoot = '' - #!${pkgs.stdenv.shell} - - set -euo pipefail - - ${pkgs.dockerTools.shadowSetup} - - mkdir -p /share /data /tmp - - ${link solid "/share/solid.pill"} - ${link brass "/share/brass.pill"} - ${link ivory "/share/ivory.pill"} - ''; - - contents = [ urbit herb ]; - - config = { - Entrypoint = [ urbit.meta.name ]; - - WorkingDir = "/data"; - - Volumes = { - "/data" = {}; - }; - - ExposedPorts = { - "80/tcp" = {}; - "443/tcp" = {}; - }; - }; -} diff --git a/nix/ops/ivory/builder.sh b/nix/ops/ivory/builder.sh deleted file mode 100755 index 1e929a84fd..0000000000 --- a/nix/ops/ivory/builder.sh +++ /dev/null @@ -1,22 +0,0 @@ -source $stdenv/setup - -set -ex - -cp -r $PIER ./pier -chmod -R u+rw ./pier - -$URBIT -d ./pier - -cleanup () { - if [ -e ./pier/.vere.lock ] - then kill $(< ./pier/.vere.lock) || true; - fi -} - -trap cleanup EXIT - -herb ./pier -P ivory.pill -d '+ivory' - -mv ivory.pill $out - -set +x diff --git a/nix/ops/ivory/default.nix b/nix/ops/ivory/default.nix deleted file mode 100644 index 36532b7b55..0000000000 --- a/nix/ops/ivory/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, herb, urbit, pier, arvo }: - -pkgs.stdenv.mkDerivation rec { - name = "ivory"; - builder = ./builder.sh; - buildInputs = [ herb pkgs.coreutils ]; - - URBIT = urbit.meta.exe; - PIER = pier; - ARVO = arvo; -} diff --git a/nix/ops/solid/builder.sh b/nix/ops/solid/builder.sh deleted file mode 100755 index f5b39a057f..0000000000 --- a/nix/ops/solid/builder.sh +++ /dev/null @@ -1,82 +0,0 @@ -source $stdenv/setup - -set -ex - -cp -r $PIER ./pier -chmod -R u+rw ./pier - -$URBIT -d ./pier - -shutdown () { - if [ -e ./pier/.vere.lock ] - then kill $(< ./pier/.vere.lock) || true; - fi -} - -trap shutdown EXIT - -# update pill strategy to ensure correct staging -# - -herb ./pier -p hood -d "+hood/mount /=home=" - -until [ -d ./pier/home ] -do - sleep 1 -done - -# update :lens, :dojo and dependencies -# -# XX reduce this list -# -cp $ARVO/app/lens.hoon ./pier/home/app/ 2>/dev/null || true -cp $ARVO/app/dojo.hoon ./pier/home/app/ 2>/dev/null || true -cp $ARVO/lib/base64.hoon ./pier/home/lib/ 2>/dev/null || true -cp $ARVO/lib/server.hoon ./pier/home/lib/ 2>/dev/null || true -cp $ARVO/lib/sole.hoon ./pier/home/lib/ 2>/dev/null || true -cp $ARVO/lib/xray.hoon ./pier/home/lib/ 2>/dev/null || true -cp $ARVO/lib/pprint.hoon ./pier/home/lib/ 2>/dev/null || true -mkdir -p ./pier/home/mar/lens/ -cp $ARVO/mar/lens/* ./pier/home/mar/lens/ 2>/dev/null || true - -cp $ARVO/sur/lens.hoon ./pier/home/sur/ 2>/dev/null || true -cp $ARVO/sur/sole.hoon ./pier/home/sur/ 2>/dev/null || true - -# update +solid and its dependencies -# -cp $ARVO/lib/pill.hoon ./pier/home/lib/ 2>/dev/null || true -cp $ARVO/gen/solid.hoon ./pier/home/gen/ 2>/dev/null || true - -chmod -R u+rw ./pier/home/ - -herb ./pier -p hood -d "+hood/commit %home" -herb ./pier -p hood -d "+hood/unmount %home" - -# XX horrible hack to ensure the update is applied first -# -sleep 10 - -# stage new desk for pill contents -# -herb ./pier -p hood -d '+hood/merge %stage our %home' -herb ./pier -p hood -d "+hood/mount /=stage=" - -until [ -d ./pier/stage ] -do - sleep 1 -done - -rm -rf ./pier/stage -cp -r $ARVO ./pier/stage -chmod -R u+rw ./pier/stage - -herb ./pier -p hood -d "+hood/commit %stage" -herb ./pier -p hood -d "+hood/unmount %stage" - -herb ./pier -P solid.pill -d '+solid /=stage=/sys, =dub &' - -herb ./pier -p hood -d '+hood/exit' || true - -mv solid.pill $out - -set +x diff --git a/nix/ops/solid/default.nix b/nix/ops/solid/default.nix deleted file mode 100644 index 050763c3b7..0000000000 --- a/nix/ops/solid/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, herb, urbit, pier, arvo }: - -pkgs.stdenv.mkDerivation rec { - name = "solid"; - builder = ./builder.sh; - buildInputs = [ herb pkgs.coreutils ]; - - URBIT = urbit.meta.exe; - PIER = pier; - ARVO = arvo; -} diff --git a/nix/ops/test/builder.sh b/nix/ops/test/builder.sh deleted file mode 100644 index 2746797abf..0000000000 --- a/nix/ops/test/builder.sh +++ /dev/null @@ -1,80 +0,0 @@ -source $stdenv/setup - -set -ex - -cp -r $SHIP ./ship -chmod -R u+rw ./ship - -$URBIT -d ./ship 2> urbit-output - -tail -f urbit-output >&2 & -tailproc=$! - -shutdown () { - if [ -e ./ship/.vere.lock ] - then kill $(< ./ship/.vere.lock) || true; - fi - - kill "$tailproc" || true; -} - -trap shutdown EXIT - -herb ./ship -p hood -d '+hood/mass' - -# Run the unit tests and then print scrollback -herb ./ship -d '~& ~ ~& %test-unit-start ~' -herb ./ship -d '####-test %/tests' -herb ./ship -d '~& ~ ~& %test-unit-end ~' - -# Start and run the test app -herb ./ship -p hood -d '+hood/start %test' - -herb ./ship -d '~& ~ ~& %test-agents-start ~' -herb ./ship -p test -d '%agents' -herb ./ship -d '~& ~ ~& %test-agents-end ~' - -herb ./ship -d '~& ~ ~& %test-generators-start ~' -herb ./ship -p test -d '%generators' -herb ./ship -d '~& ~ ~& %test-generators-end ~' - -herb ./ship -d '~& ~ ~& %test-marks-start ~' -herb ./ship -p test -d '%marks' -herb ./ship -d '~& ~ ~& %test-marks-end ~' - -# compact the loom, comparing memory use before and after -herb ./ship -p hood -d '+hood/mass' - -herb ./ship -d '~& ~ ~& %pack-start ~' -herb ./ship -p hood -d '+hood/pack' -herb ./ship -d '~& ~ ~& %pack-end ~' - -herb ./ship -p hood -d '+hood/mass' - -shutdown - -# Collect output - -cp urbit-output test-output-unit -cp urbit-output test-output-agents -cp urbit-output test-output-generators -cp urbit-output test-output-marks -rm urbit-output - -sed -i '0,/test-unit-start/d' test-output-unit -sed -i '/test-unit-end/,$d' test-output-unit - -sed -i '0,/test-agents-start/d' test-output-agents -sed -i '/test-agents-end/,$d' test-output-agents - -sed -i '0,/test-generators-start/d' test-output-generators -sed -i '/test-generators-end/,$d' test-output-generators - -sed -i '0,/test-marks-start/d' test-output-marks -sed -i '/test-marks-end/,$d' test-output-marks - -mkdir $out - -cp -r test-output-* $out/ - -set +x diff --git a/nix/ops/test/default.nix b/nix/ops/test/default.nix deleted file mode 100644 index e901d2dc58..0000000000 --- a/nix/ops/test/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, herb, urbit, ship }: - -pkgs.stdenv.mkDerivation rec { - name = "test"; - builder = ./builder.sh; - buildInputs = [ herb ]; - - URBIT = urbit.meta.exe; - SHIP = ship; -} diff --git a/nix/overlays/arm.nix b/nix/overlays/arm.nix new file mode 100644 index 0000000000..62bb1eb0de --- /dev/null +++ b/nix/overlays/arm.nix @@ -0,0 +1,13 @@ +final: prev: + +let + + isAarch64 = prev.stdenv.hostPlatform.isAarch64; + +in prev.lib.optionalAttrs isAarch64 { + libsigsegv = prev.libsigsegv.overrideAttrs (attrs: { + preConfigure = (old.preConfigure or "") + '' + sed -i 's/^CFG_FAULT=$/CFG_FAULT=fault-linux-arm.h/' configure + ''; + }); +} diff --git a/nix/overlays/musl.nix b/nix/overlays/musl.nix new file mode 100644 index 0000000000..857cb75041 --- /dev/null +++ b/nix/overlays/musl.nix @@ -0,0 +1,28 @@ +final: prev: + +let + + isMusl = prev.stdenv.hostPlatform.isMusl; + + optionalList = xs: if xs == null then [ ] else xs; + + overrideStdenv = pkg: pkg.override { stdenv = prev.gcc9Stdenv; }; + +in prev.lib.optionalAttrs isMusl { + libsigsegv = prev.libsigsegv.overrideAttrs (attrs: { + preConfigure = (attrs.preConfigure or "") + '' + sed -i 's/^CFG_FAULT=$/CFG_FAULT=fault-linux-i386.h/' configure + ''; + }); + + secp256k1 = prev.secp256k1.overrideAttrs (attrs: { + nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) + ++ [ prev.buildPackages.stdenv.cc ]; + }); + + rhash = overrideStdenv prev.rhash; + + numactl = overrideStdenv prev.numactl; + + lmdb = overrideStdenv prev.lmdb; +} diff --git a/nix/overlays/native.nix b/nix/overlays/native.nix new file mode 100644 index 0000000000..2ab55e3751 --- /dev/null +++ b/nix/overlays/native.nix @@ -0,0 +1,28 @@ +final: prev: + +let + + optionalList = xs: if xs == null then [ ] else xs; + +in { + h2o = prev.h2o.overrideAttrs (_attrs: { + version = final.sources.h2o.rev; + src = final.sources.h2o; + outputs = [ "out" "dev" "lib" ]; + }); + + libsigsegv = prev.libsigsegv.overrideAttrs (attrs: { + patches = optionalList attrs.patches ++ [ + ../pkgs/libsigsegv/disable-stackvma_fault-linux-arm.patch + ../pkgs/libsigsegv/disable-stackvma_fault-linux-i386.patch + ]; + }); + + curlMinimal = prev.curl.override { + http2Support = false; + scpSupport = false; + gssSupport = false; + ldapSupport = false; + brotliSupport = false; + }; +} diff --git a/nix/overlays/static.nix b/nix/overlays/static.nix new file mode 100644 index 0000000000..fa0cfdd89a --- /dev/null +++ b/nix/overlays/static.nix @@ -0,0 +1,37 @@ +final: prev: + +let + + # https://github.com/NixOS/nixpkgs/pull/97047/files + # Will make pkgs.stdenv.isStatic available indepedent of the platform. + # isStatic = prev.stdenv.hostPlatform.isStatic; + + configureFlags = attrs: { + configureFlags = (attrs.configureFlags or [ ]) + ++ [ "--disable-shared" "--enable-static" ]; + }; + + enableStatic = pkg: pkg.overrideAttrs configureFlags; + +in { + gmp = enableStatic prev.gmp; + + curlMinimal = enableStatic prev.curlMinimal; + + libuv = enableStatic prev.libuv; + + libffi = enableStatic prev.libffi; + + secp256k1 = enableStatic prev.secp256k1; + + lmdb = prev.lmdb.overrideAttrs (old: + configureFlags old // { + # Why remove the so version? It's easier than preventing it from being + # built with lmdb's custom Makefiles, and it can't exist in the output + # because otherwise the linker will preferentially choose the .so over + # the .a. + postInstall = '' + rm $out/lib/liblmdb.so + ''; + }); +} diff --git a/nix/pkgs/argon2u/default.nix b/nix/pkgs/argon2u/default.nix new file mode 100644 index 0000000000..60c7a10896 --- /dev/null +++ b/nix/pkgs/argon2u/default.nix @@ -0,0 +1,30 @@ +{ stdenv, sources, enableParallelBuilding ? true }: + +stdenv.mkDerivation { + pname = "argon2u"; + version = sources.argon2u.rev; + src = sources.argon2u; + + postPatch = '' + substituteInPlace Makefile --replace 'ar rcs' '$(AR) rcs' + ''; + + buildPhase = '' + make libargon2.a + ''; + + installPhase = '' + mkdir -p $out/{lib,include} + cp libargon2.a $out/lib/ + cp include/argon2.h $out/include/ + cp ./src/blake2/*.h $out/include/ + ''; + + makeFlags = [ + "AR=${stdenv.cc.targetPrefix}ar" # Fix cross-compilation + ]; + + NO_THREADS = true; + + inherit enableParallelBuilding; +} diff --git a/nix/pkgs/arvo-ropsten/builder.sh b/nix/pkgs/arvo-ropsten/builder.sh deleted file mode 100644 index af133a2f27..0000000000 --- a/nix/pkgs/arvo-ropsten/builder.sh +++ /dev/null @@ -1,26 +0,0 @@ -source $stdenv/setup - -cp -r $src tmp -chmod -R u+w tmp - -ZUSE=tmp/sys/zuse.hoon -AMES=tmp/sys/vane/ames.hoon -ACME=tmp/app/acme.hoon - -# replace the mainnet azimuth contract with the ropsten contract -sed --in-place \ - 's/\(\+\+ contracts \)mainnet\-contracts/\1ropsten-contracts/' \ - $ZUSE - -# increment the %ames protocol version -sed -r --in-place \ - 's_^(=/ protocol\-version=\?\(.*\) %)([0-7])_echo "\1$(echo "(\2+1) % 8" | bc)"_e' \ - $AMES - -# use the staging API in :acme -sed --in-place \ - 's_https://acme-v02.api.letsencrypt.org/directory_https://acme-staging-v02.api.letsencrypt.org/directory_' \ - $ACME - -cp -r tmp $out -chmod -R u+w $out diff --git a/nix/pkgs/arvo-ropsten/default.nix b/nix/pkgs/arvo-ropsten/default.nix deleted file mode 100644 index 9f4bb7e7d1..0000000000 --- a/nix/pkgs/arvo-ropsten/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs }: - -pkgs.stdenv.mkDerivation { - name = "arvo-ropsten"; - buildInputs = [ pkgs.bc ]; - builder = ./builder.sh; - src = pkgs.buildRustCrateHelpers.exclude [ ".git" ] ../../../pkg/arvo; -} diff --git a/nix/pkgs/arvo/builder.sh b/nix/pkgs/arvo/builder.sh deleted file mode 100644 index 3a0c49ad29..0000000000 --- a/nix/pkgs/arvo/builder.sh +++ /dev/null @@ -1,4 +0,0 @@ -source $stdenv/setup - -cp -r $src/ $out -chmod -R u+w $out diff --git a/nix/pkgs/arvo/default.nix b/nix/pkgs/arvo/default.nix index 8b31237cf1..c9204a01fa 100644 --- a/nix/pkgs/arvo/default.nix +++ b/nix/pkgs/arvo/default.nix @@ -1,10 +1,46 @@ -{ pkgs }: +{ lib, stdenvNoCC, bc }: -pkgs.stdenv.mkDerivation { +stdenvNoCC.mkDerivation { name = "arvo"; - builder = ./builder.sh; - src = pkgs.buildRustCrateHelpers.exclude [ ".git" ] ../../../pkg/arvo; - meta = { - priority = 0; - }; + src = lib.cleanSource ../../../pkg/arvo; + + buildInputs = [ bc ]; + + outputs = [ "out" "ropsten" ]; + + phases = [ "mainnetPhase" "ropstenPhase" ]; + + mainnetPhase = '' + cp -r $src/ $out + chmod -R u+w $out + ''; + + ropstenPhase = '' + cp -r $src tmp + chmod -R u+w tmp + + ZUSE=tmp/sys/zuse.hoon + AMES=tmp/sys/vane/ames.hoon + ACME=tmp/app/acme.hoon + + # Replace the mainnet azimuth contract with the ropsten contract + sed --in-place \ + 's/\(\+\+ contracts \)mainnet\-contracts/\1ropsten-contracts/' \ + $ZUSE + + # Increment the %ames protocol version + sed -r --in-place \ + 's_^(=/ protocol\-version=\?\(.*\) %)([0-7])_echo "\1$(echo "(\2+1) % 8" | bc)"_e' \ + $AMES + + # Use the staging API in :acme + sed --in-place \ + 's_https://acme-v02.api.letsencrypt.org/directory_https://acme-staging-v02.api.letsencrypt.org/directory_' \ + $ACME + + cp -r tmp $ropsten + chmod -R u+w $ropsten + ''; + + preferLocalBuild = true; } diff --git a/nix/pkgs/ca-bundle/default.nix b/nix/pkgs/ca-bundle/default.nix new file mode 100644 index 0000000000..ddef1fb3e5 --- /dev/null +++ b/nix/pkgs/ca-bundle/default.nix @@ -0,0 +1,29 @@ +{ stdenvNoCC, xxd, cacert }: + +stdenvNoCC.mkDerivation { + name = "ca-bundle"; + + nativeBuildInputs = [ cacert xxd ]; + + phases = [ "installPhase" ]; + + installPhase = '' + set -euo pipefail + + if ! [ -f "$SSL_CERT_FILE" ]; then + header "$SSL_CERT_FILE doesn't exist" + exit 1 + fi + + mkdir include + + cat $SSL_CERT_FILE > include/ca-bundle.crt + xxd -i include/ca-bundle.crt > ca-bundle.h + + mkdir -p $out/include + + mv ca-bundle.h $out/include + ''; + + preferLocalBuild = true; +} diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix deleted file mode 100644 index ba1129dd31..0000000000 --- a/nix/pkgs/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs ? import ../nixpkgs.nix }: - -let - - deps = import ../deps { inherit pkgs; }; - - ent = import ./ent { inherit pkgs; }; - arvo = import ./arvo { inherit pkgs; }; - arvo-ropsten = import ./arvo-ropsten { inherit pkgs; }; - herb = import ../../pkg/herb { inherit pkgs; }; - - ge-additions = import ./ge-additions { - inherit pkgs; - inherit (deps) ed25519; - }; - - libaes_siv = import ./libaes_siv { - inherit pkgs; - }; - - mkUrbit = { debug }: - import ./urbit { - inherit pkgs ent debug ge-additions libaes_siv; - inherit (deps) argon2 murmur3 uv ed25519 scrypt softfloat3; - inherit (deps) secp256k1 h2o ivory-header ca-header; - }; - - urbit = mkUrbit { debug = false; }; - urbit-debug = mkUrbit { debug = true; }; - -in - -{ inherit ent ge-additions libaes_siv arvo arvo-ropsten herb urbit urbit-debug; } diff --git a/nix/pkgs/ed25519/default.nix b/nix/pkgs/ed25519/default.nix new file mode 100644 index 0000000000..7edd85223e --- /dev/null +++ b/nix/pkgs/ed25519/default.nix @@ -0,0 +1,21 @@ +{ stdenv, sources }: + +stdenv.mkDerivation { + pname = "ed25519"; + version = sources.ed25519.rev; + src = sources.ed25519; + + buildPhase = '' + CFLAGS="-O3 -Wall -I$src/src" + + for f in $(find src -type f -name '*.c'); do + $CC $CFLAGS -c $f -o "''${f//\//_}.o" + done + ''; + + installPhase = '' + mkdir -p $out/{lib,include} + $AR rcs $out/lib/libed25519.a *.o + cp $src/src/*.h $out/include/ + ''; +} diff --git a/nix/pkgs/ent/builder.sh b/nix/pkgs/ent/builder.sh deleted file mode 100644 index 464f62e0ba..0000000000 --- a/nix/pkgs/ent/builder.sh +++ /dev/null @@ -1,8 +0,0 @@ -source $stdenv/setup - -cp -r $src ./src -chmod -R u+w ./src -cd ./src - -bash ./configure -PREFIX=$out make install diff --git a/nix/pkgs/ent/cross.nix b/nix/pkgs/ent/cross.nix deleted file mode 100644 index e84d7a01ed..0000000000 --- a/nix/pkgs/ent/cross.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ env_name, env, deps }: - -env.make_derivation rec { - name = "ent-7506f"; - builder = ./builder.sh; - src = ../../../pkg/ent; - - CC = "${env.host}-gcc"; - AR = "${env.host}-ar"; -} diff --git a/nix/pkgs/ent/default.nix b/nix/pkgs/ent/default.nix index ce7c2088cc..ee13758f58 100644 --- a/nix/pkgs/ent/default.nix +++ b/nix/pkgs/ent/default.nix @@ -1,7 +1,14 @@ -{ pkgs }: +{ lib, stdenv, enableParallelBuilding ? true }: -pkgs.stdenv.mkDerivation rec { - name = "ent-7506f"; - builder = ./builder.sh; - src = ../../../pkg/ent; +stdenv.mkDerivation { + name = "ent"; + src = lib.cleanSource ../../../pkg/ent; + + postPatch = '' + patchShebangs ./configure + ''; + + installFlags = [ "PREFIX=$(out)" ]; + + inherit enableParallelBuilding; } diff --git a/nix/pkgs/ge-additions/builder.sh b/nix/pkgs/ge-additions/builder.sh deleted file mode 100644 index 5a04043770..0000000000 --- a/nix/pkgs/ge-additions/builder.sh +++ /dev/null @@ -1,7 +0,0 @@ -source $stdenv/setup - -cp -r $src ./src -chmod -R u+w ./src -cd ./src - -PREFIX=$out make install diff --git a/nix/pkgs/ge-additions/cross.nix b/nix/pkgs/ge-additions/cross.nix deleted file mode 100644 index f16afad0bf..0000000000 --- a/nix/pkgs/ge-additions/cross.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ env_name, env, deps }: - -env.make_derivation rec { - name = "ge-additions"; - builder = ./release.sh; - src = ../../../pkg/ge-additions; - - cross_inputs = [ deps.ed25519 ]; - - CC = "${env.host}-gcc"; - AR = "${env.host}-ar"; -} diff --git a/nix/pkgs/ge-additions/default.nix b/nix/pkgs/ge-additions/default.nix index e77098cffb..e317972d6d 100644 --- a/nix/pkgs/ge-additions/default.nix +++ b/nix/pkgs/ge-additions/default.nix @@ -1,9 +1,13 @@ -{ pkgs, ed25519 }: +{ lib, stdenv, ed25519, enableParallelBuilding ? true }: -pkgs.stdenv.mkDerivation rec { - name = "ge-additions"; - builder = ./builder.sh; - src = ../../../pkg/ge-additions; +stdenv.mkDerivation { + name = "ge-additions"; + src = lib.cleanSource ../../../pkg/ge-additions; - nativeBuildInputs = [ ed25519 ]; + buildInputs = [ ed25519 ]; + + installFlags = [ "PREFIX=$(out)" ]; + + inherit enableParallelBuilding; } + diff --git a/nix/pkgs/ge-additions/release.sh b/nix/pkgs/ge-additions/release.sh deleted file mode 100644 index aaa54b5e13..0000000000 --- a/nix/pkgs/ge-additions/release.sh +++ /dev/null @@ -1,13 +0,0 @@ -source $setup - -cp -r $src ./src -chmod -R u+w ./src -cd ./src - -for dep in $cross_inputs; do - export CFLAGS="${CFLAGS-} -I$dep/include" - export LDFLAGS="${LDFLAGS-} -L$dep/lib" -done - -PREFIX=$out make install - diff --git a/nix/pkgs/herb/default.nix b/nix/pkgs/herb/default.nix new file mode 100644 index 0000000000..ac9ae8dca7 --- /dev/null +++ b/nix/pkgs/herb/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenvNoCC, python }: + +# Avoid using `python.withPackages` as it creates a wrapper script to set +# PYTHONPATH, and the script is used verbatim as a python shebang. +# +# Unfortunately Darwin does not allow scripts as a shebang - so to get a +# cross platform python interpreter with appropriate site-packages setup +# we use `wrapPython/Packages` which handles these cases correctly. + +stdenvNoCC.mkDerivation { + name = "herb"; + src = ../../../pkg/herb/herb; + + nativeBuildInputs = [ python.pkgs.wrapPython ]; + buildInputs = [ python python.pkgs.requests ]; + pythonPath = [ python.pkgs.requests ]; + + phases = [ "installPhase" "fixupPhase" ]; + + installPhase = '' + mkdir -p $out/bin + cp $src $out/bin/herb + chmod +x $out/bin/herb + ''; + + postFixup = '' + wrapPythonPrograms + ''; +} diff --git a/nix/pkgs/hs/default.nix b/nix/pkgs/hs/default.nix new file mode 100644 index 0000000000..5dd7ae1865 --- /dev/null +++ b/nix/pkgs/hs/default.nix @@ -0,0 +1,91 @@ +{ lib, stdenv, darwin, haskell-nix, gmp, zlib, libffi, checkMaterialization +, enableStatic ? stdenv.hostPlatform.isStatic }: + +let + + compiler-nix-name = "ghc884"; + index-state = "2020-09-24T00:00:00Z"; + + project = haskell-nix.stackProject { + inherit compiler-nix-name index-state checkMaterialization; + + # This is incredibly difficult to get right, almost everything goes wrong. + # See: https://github.com/input-output-hk/haskell.nix/issues/496 + src = haskell-nix.haskellLib.cleanSourceWith { + # Otherwise this depends on the name in the parent directory, which + # reduces caching, and is particularly bad on Hercules. + # See: https://github.com/hercules-ci/support/issues/40 + name = "urbit-hs"; + src = ../../../pkg/hs; + }; + + modules = [{ + # This corresponds to the set of packages (boot libs) that ship with GHC. + # We declare them yere to ensure any dependency gets them from GHC itself + # rather than trying to re-install them into the package database. + nonReinstallablePkgs = [ + "Cabal" + "Win32" + "array" + "base" + "binary" + "bytestring" + "containers" + "deepseq" + "directory" + "filepath" + "ghc" + "ghc-boot" + "ghc-boot-th" + "ghc-compact" + "ghc-heap" + "ghc-prim" + "ghci" + "ghcjs-prim" + "ghcjs-th" + "haskeline" + "hpc" + "integer-gmp" + "integer-simple" + "mtl" + "parsec" + "pretty" + "process" + "rts" + "stm" + "template-haskell" + "terminfo" + "text" + "time" + "transformers" + "unix" + "xhtml" + ]; + + packages = { + # Disable the urbit-king test-suite for now - since it relies + # on relative paths to lfs pills. + urbit-king.doCheck = false; + urbit-king.components.exes.urbit-king.enableStatic = enableStatic; + urbit-king.components.exes.urbit-king.enableShared = !enableStatic; + urbit-king.components.exes.urbit-king.configureFlags = + lib.optionals enableStatic [ + "--ghc-option=-optl=-L${gmp}/lib" + "--ghc-option=-optl=-L${libffi}/lib" + "--ghc-option=-optl=-L${zlib}/lib" + ] ++ lib.optionals (enableStatic && stdenv.isDarwin) + [ "--ghc-option=-optl=-L${darwin.libiconv}/lib" ]; + }; + }]; + }; + +in project // { + # Build and obtain an executable from Hackage, using the same compiler + # and cabal index-state as the stackProject. + # + # This allows specifying the executable name, in contrast with shellFor.tools. + hackageTool = { name, version, exe ? lib.toLower name }: + (haskell-nix.hackage-package { + inherit compiler-nix-name index-state name version; + }).components.exes.${exe}; +} diff --git a/nix/pkgs/libaes_siv/builder.sh b/nix/pkgs/libaes_siv/builder.sh deleted file mode 100644 index 5a04043770..0000000000 --- a/nix/pkgs/libaes_siv/builder.sh +++ /dev/null @@ -1,7 +0,0 @@ -source $stdenv/setup - -cp -r $src ./src -chmod -R u+w ./src -cd ./src - -PREFIX=$out make install diff --git a/nix/pkgs/libaes_siv/cross.nix b/nix/pkgs/libaes_siv/cross.nix deleted file mode 100644 index f782400584..0000000000 --- a/nix/pkgs/libaes_siv/cross.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ env_name, env, deps }: - -env.make_derivation rec { - name = "libaes_siv"; - builder = ./release.sh; - src = ../../../pkg/libaes_siv; - - cross_inputs = [ env.openssl ]; - - CC = "${env.host}-gcc"; - AR = "${env.host}-ar"; -} diff --git a/nix/pkgs/libaes_siv/default.nix b/nix/pkgs/libaes_siv/default.nix index fbdda7ebed..8b298f72f7 100644 --- a/nix/pkgs/libaes_siv/default.nix +++ b/nix/pkgs/libaes_siv/default.nix @@ -1,9 +1,12 @@ -{ pkgs }: +{ lib, stdenv, openssl, enableParallelBuilding ? true }: -pkgs.stdenv.mkDerivation rec { - name = "libaes_siv"; - builder = ./builder.sh; - src = ../../../pkg/libaes_siv; +stdenv.mkDerivation { + name = "libaes_siv"; + src = lib.cleanSource ../../../pkg/libaes_siv; - nativeBuildInputs = [ pkgs.openssl ]; + buildInputs = [ openssl ]; + + installFlags = [ "PREFIX=$(out)" ]; + + inherit enableParallelBuilding; } diff --git a/nix/pkgs/libaes_siv/release.sh b/nix/pkgs/libaes_siv/release.sh deleted file mode 100644 index aaa54b5e13..0000000000 --- a/nix/pkgs/libaes_siv/release.sh +++ /dev/null @@ -1,13 +0,0 @@ -source $setup - -cp -r $src ./src -chmod -R u+w ./src -cd ./src - -for dep in $cross_inputs; do - export CFLAGS="${CFLAGS-} -I$dep/include" - export LDFLAGS="${LDFLAGS-} -L$dep/lib" -done - -PREFIX=$out make install - diff --git a/nix/pkgs/libscrypt/default.nix b/nix/pkgs/libscrypt/default.nix new file mode 100644 index 0000000000..55ed88f2cb --- /dev/null +++ b/nix/pkgs/libscrypt/default.nix @@ -0,0 +1,35 @@ +{ stdenv, sources }: + +stdenv.mkDerivation { + pname = "libscrypt"; + version = sources.libscrypt.rev; + src = sources.libscrypt; + + buildPhase = '' + sources=" \ + crypto_scrypt-check \ + crypto_scrypt-hash \ + crypto_scrypt-hexconvert \ + crypto_scrypt-nosse \ + crypto-mcf \ + crypto-scrypt-saltgen \ + slowequals \ + sha256 \ + b64 \ + " + + CFLAGS="-I$src -Wall -ffast-math -O3 -D_FORTIFY_SOURCE=2 -fstack-protector" + + for s in $sources; do + $CC $CFLAGS -c $src/$s.c -o $s.o + done + + $AR rcs libscrypt.a *.o + ''; + + installPhase = '' + mkdir -p $out/{lib,include} + cp libscrypt.a $out/lib + cp $src/*.h $out/include/ + ''; +} diff --git a/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-arm.patch b/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-arm.patch new file mode 100644 index 0000000000..56d2b4b757 --- /dev/null +++ b/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-arm.patch @@ -0,0 +1,11 @@ +--- a/src/fault-linux-arm.h ++++ b/src/fault-linux-arm.h +@@ -17,6 +17,8 @@ + + #include "fault-posix-ucontext.h" + ++#define HAVE_STACKVMA 0 ++ + #if defined(__aarch64__) || defined(__ARM_64BIT_STATE) || defined(__ARM_PCS_AAPCS64) /* 64-bit */ + + /* See glibc/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h. diff --git a/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-i386.patch b/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-i386.patch new file mode 100644 index 0000000000..9d7d03bd16 --- /dev/null +++ b/nix/pkgs/libsigsegv/disable-stackvma_fault-linux-i386.patch @@ -0,0 +1,11 @@ +--- a/src/fault-linux-i386.h ++++ b/src/fault-linux-i386.h +@@ -18,6 +18,8 @@ + + #include "fault-posix-ucontext.h" + ++#define HAVE_STACKVMA 0 ++ + #if defined __x86_64__ + /* 64 bit registers */ + diff --git a/nix/pkgs/murmur3/default.nix b/nix/pkgs/murmur3/default.nix new file mode 100644 index 0000000000..abac84c95c --- /dev/null +++ b/nix/pkgs/murmur3/default.nix @@ -0,0 +1,17 @@ +{ stdenv, sources }: + +stdenv.mkDerivation { + pname = "murmur3"; + version = sources.murmur3.rev; + src = sources.murmur3; + + buildPhase = '' + $CC -fPIC -O3 -o murmur3.o -c $src/murmur3.c + ''; + + installPhase = '' + mkdir -p $out/{lib,include} + $AR rcs $out/lib/libmurmur3.a murmur3.o + cp $src/*.h $out/include/ + ''; +} diff --git a/nix/pkgs/pill/brass.nix b/nix/pkgs/pill/brass.nix new file mode 100644 index 0000000000..54a816df0a --- /dev/null +++ b/nix/pkgs/pill/brass.nix @@ -0,0 +1,22 @@ +{ lib, stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, herb +, withRopsten ? false }: + +let + + lfs = fetchGitHubLFS { src = ../../../bin/brass.pill; }; + +in { + build = import ./builder.nix { + inherit stdenvNoCC urbit herb; + + name = "brass" + lib.optionalString withRopsten "-ropsten"; + builder = ./brass.sh; + arvo = if withRopsten then arvo.ropsten else arvo; + pier = bootFakeShip { + inherit urbit herb; + + pill = solid.lfs; + ship = "zod"; + }; + }; +} // lib.optionalAttrs (!withRopsten) { inherit lfs; } diff --git a/nix/pkgs/pill/brass.sh b/nix/pkgs/pill/brass.sh new file mode 100644 index 0000000000..114578d6b9 --- /dev/null +++ b/nix/pkgs/pill/brass.sh @@ -0,0 +1,23 @@ +source $stdenv/setup + +set -euo pipefail + +cp -r $src ./pier +chmod -R u+rw ./pier + +urbit -d ./pier + +cleanup () { + if [ -f ./pier/.vere.lock ]; then + kill $(< ./pier/.vere.lock) || true + fi +} + +trap cleanup EXIT + +header "running herb +brass" + +herb ./pier -P brass.pill -d '+brass' +herb ./pier -p hood -d '+hood/exit' + +stopNest diff --git a/nix/pkgs/pill/builder.nix b/nix/pkgs/pill/builder.nix new file mode 100644 index 0000000000..dc9a67afb6 --- /dev/null +++ b/nix/pkgs/pill/builder.nix @@ -0,0 +1,23 @@ +{ stdenvNoCC, urbit, arvo, herb, name, builder, pier }: + +stdenvNoCC.mkDerivation { + name = "${name}.pill"; + src = pier; + outputs = [ "out" "hash" ]; + buildInputs = [ urbit herb ]; + + dontUnpack = true; + + buildPhase = builtins.readFile builder; + + installPhase = '' + mv ${name}.pill $out + + mkdir $hash + + md5sum $out | awk '{printf $1}' > $hash/md5 + sha256sum $out | awk '{printf $1}' > $hash/sha256 + ''; + + ARVO = arvo; +} diff --git a/nix/pkgs/pill/ivory.nix b/nix/pkgs/pill/ivory.nix new file mode 100644 index 0000000000..354cfbd396 --- /dev/null +++ b/nix/pkgs/pill/ivory.nix @@ -0,0 +1,42 @@ +{ lib, stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, herb, xxd +, withRopsten ? false }: + +let + + lfs = fetchGitHubLFS { src = ../../../bin/ivory.pill; }; + +in { + build = import ./builder.nix { + inherit stdenvNoCC urbit herb; + + name = "ivory" + lib.optionalString withRopsten "-ropsten"; + builder = ./ivory.sh; + arvo = if withRopsten then arvo.ropsten else arvo; + pier = bootFakeShip { + inherit urbit herb; + + pill = solid.lfs; + ship = "zod"; + }; + }; + + # The hexdump of the `.lfs` pill contents as a C header. + header = stdenvNoCC.mkDerivation { + name = "ivory-header"; + src = lfs; + nativeBuildInputs = [ xxd ]; + phases = [ "installPhase" ]; + + installPhase = '' + file=u3_Ivory.pill + + header "writing $file" + + mkdir -p $out/include + cat $src > $file + xxd -i $file > $out/include/ivory.h + ''; + + preferLocalBuild = true; + }; +} // lib.optionalAttrs (!withRopsten) { inherit lfs; } diff --git a/nix/pkgs/pill/ivory.sh b/nix/pkgs/pill/ivory.sh new file mode 100644 index 0000000000..fc5ced9a66 --- /dev/null +++ b/nix/pkgs/pill/ivory.sh @@ -0,0 +1,23 @@ +source $stdenv/setup + +set -euo pipefail + +cp -r $src ./pier +chmod -R u+rw ./pier + +urbit -d ./pier + +cleanup () { + if [ -f ./pier/.vere.lock ]; then + kill $(< ./pier/.vere.lock) || true + fi +} + +trap cleanup EXIT + +header "running herb +ivory" + +herb ./pier -P ivory.pill -d '+ivory' +herb ./pier -p hood -d '+hood/exit' + +stopNest diff --git a/nix/pkgs/pill/solid.nix b/nix/pkgs/pill/solid.nix new file mode 100644 index 0000000000..17bcd4433e --- /dev/null +++ b/nix/pkgs/pill/solid.nix @@ -0,0 +1,23 @@ +{ stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, herb }: + +let + + lfs = fetchGitHubLFS { src = ../../../bin/solid.pill; }; + +in { + inherit lfs; + + build = import ./builder.nix { + inherit stdenvNoCC urbit arvo herb; + + name = "solid"; + builder = ./solid.sh; + pier = bootFakeShip { + inherit urbit herb; + + arvo = null; + pill = solid.lfs; + ship = "zod"; + }; + }; +} diff --git a/nix/pkgs/pill/solid.sh b/nix/pkgs/pill/solid.sh new file mode 100644 index 0000000000..1e395f09f5 --- /dev/null +++ b/nix/pkgs/pill/solid.sh @@ -0,0 +1,73 @@ +source $stdenv/setup + +set -euo pipefail + +ARVO=${ARVO?:ARVO location is unset} + +cp -r $src ./pier +chmod -R u+rw ./pier + +urbit -d ./pier + +cleanup () { + if [ -f ./pier/.vere.lock ]; then + kill $(< ./pier/.vere.lock) || true + fi +} + +trap cleanup EXIT + +# Update pill strategy to ensure correct staging +herb ./pier -p hood -d "+hood/mount /=home=" + +until [ -d ./pier/home ]; do + sleep 1 +done + +# Update :lens, :dojo and dependencies +# FIXME: reduce this list +cp $ARVO/app/lens.hoon ./pier/home/app/ +cp $ARVO/app/dojo.hoon ./pier/home/app/ +cp $ARVO/lib/base64.hoon ./pier/home/lib/ +cp $ARVO/lib/server.hoon ./pier/home/lib/ +cp $ARVO/lib/sole.hoon ./pier/home/lib/ +cp $ARVO/lib/xray.hoon ./pier/home/lib/ +cp $ARVO/lib/pprint.hoon ./pier/home/lib/ + +mkdir -p ./pier/home/mar/lens/ + +cp $ARVO/mar/lens/* ./pier/home/mar/lens/ + +cp $ARVO/sur/lens.hoon ./pier/home/sur/ +cp $ARVO/sur/sole.hoon ./pier/home/sur/ + +# Update +solid and its dependencies +cp $ARVO/lib/pill.hoon ./pier/home/lib/ +cp $ARVO/gen/solid.hoon ./pier/home/gen/ + +chmod -R u+rw ./pier/home/ + +herb ./pier -p hood -d "+hood/commit %home" +herb ./pier -p hood -d "+hood/unmount %home" + +# FIXME: horrible hack to ensure the update is applied first +sleep 10 + +# Stage new desk for pill contents +herb ./pier -p hood -d '+hood/merge %stage our %home' +herb ./pier -p hood -d "+hood/mount /=stage=" + +until [ -d ./pier/stage ]; do + sleep 1 +done + +rm -rf ./pier/stage +cp -r $ARVO ./pier/stage +chmod -R u+rw ./pier/stage + +herb ./pier -p hood -d "+hood/commit %stage" +herb ./pier -p hood -d "+hood/unmount %stage" +herb ./pier -P solid.pill -d '+solid /=stage=/sys, =dub &' +herb ./pier -p hood -d '+hood/exit' + +stopNest diff --git a/nix/pkgs/softfloat3/default.nix b/nix/pkgs/softfloat3/default.nix new file mode 100644 index 0000000000..cae76a3662 --- /dev/null +++ b/nix/pkgs/softfloat3/default.nix @@ -0,0 +1,28 @@ +{ stdenv, sources, enableParallelBuilding ? true }: + +stdenv.mkDerivation { + pname = "softfloat3"; + version = sources.softfloat3.rev; + src = sources.softfloat3; + + postPatch = '' + for f in $(find build -type f -name 'Makefile'); do + substituteInPlace $f \ + --replace 'gcc' '$(CC)' \ + --replace 'ar crs' '$(AR) crs' + done + ''; + + preBuild = '' + cd build/Linux-x86_64-GCC + ''; + + installPhase = '' + mkdir -p $out/{lib,include} + cp $src/source/include/*.h $out/include/ + cp softfloat.a $out/lib/libsoftfloat3.a + ''; + + inherit enableParallelBuilding; +} + diff --git a/nix/pkgs/urbit/default.nix b/nix/pkgs/urbit/default.nix index 19befa1ef3..dcd62b3488 100644 --- a/nix/pkgs/urbit/default.nix +++ b/nix/pkgs/urbit/default.nix @@ -1,61 +1,73 @@ -{ - pkgs, - debug, - argon2, ed25519, ent, ge-additions, libaes_siv, h2o, murmur3, scrypt, secp256k1, softfloat3, uv, ivory-header, ca-header -}: +{ lib, stdenv, coreutils, pkgconfig, argon2u, cacert, ca-bundle, curlMinimal +, ed25519, ent, ge-additions, gmp, h2o, herb, ivory, libaes_siv, libscrypt +, libsigsegv, libuv, lmdb, murmur3, openssl, secp256k1, softfloat3, zlib +, enableStatic ? stdenv.hostPlatform.isStatic, enableDebug ? false +, doCheck ? true, enableParallelBuilding ? true }: let - name = - if debug then "urbit-debug" else "urbit"; + src = lib.cleanSource ../../../pkg/urbit; - meta = rec { - inherit debug; - bin = "${urbit}/bin/${name}"; - flags = if debug then [ "-g" ] else []; - exe = ''${meta.bin} ${pkgs.lib.strings.concatStringsSep " " meta.flags}''; - }; +in stdenv.mkDerivation { + inherit src; - sigseg = - pkgs.libsigsegv.overrideAttrs (oldAttrs: rec { - patches = [ ./libsigsegv_fix.patch ]; - }); + pname = "urbit" + lib.optionalString enableDebug "-debug" + + lib.optionalString enableStatic "-static"; - deps = - with pkgs; - [ curl gmp sigseg openssl zlib lmdb ]; + version = builtins.readFile "${src}/version"; - vendor = - [ argon2 softfloat3 ed25519 ent ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; + nativeBuildInputs = [ pkgconfig ]; - urbit = pkgs.stdenv.mkDerivation { - inherit name meta; - exename = name; - src = ../../../pkg/urbit; - nativeBuildInputs = deps ++ vendor; + buildInputs = [ + argon2u + cacert + ca-bundle + curlMinimal + ed25519 + ent + ge-additions + gmp + h2o + ivory.header + libaes_siv + libscrypt + libsigsegv + libuv + lmdb + murmur3 + openssl + secp256k1 + softfloat3 + zlib + ]; - configurePhase = '' - bash ./configure - ''; + checkInputs = [ herb ]; - installPhase = '' - make all -j8 - make test + # Ensure any `/usr/bin/env bash` shebang is patched. + postPatch = '' + patchShebangs ./configure + ''; - mkdir -p $out/bin - cp ./build/urbit $out/bin/$exename - cp ./build/urbit-worker $out/bin/$exename-worker - ''; + checkTarget = "test"; - # See https://github.com/NixOS/nixpkgs/issues/18995 - hardeningDisable = if debug then [ "all" ] else []; + installPhase = '' + mkdir -p $out/bin + cp ./build/urbit $out/bin/urbit + cp ./build/urbit-worker $out/bin/urbit-worker + ''; - CFLAGS = "-O3 -g -Werror"; - MEMORY_DEBUG = debug; - CPU_DEBUG = debug; - EVENT_TIME_DEBUG = false; - }; + CFLAGS = [ (if enableDebug then "-O0" else "-O3") "-g" ] + ++ lib.optionals (!enableDebug) [ "-Werror" ] + ++ lib.optionals enableStatic [ "-static" ]; -in + MEMORY_DEBUG = enableDebug; + CPU_DEBUG = enableDebug; + EVENT_TIME_DEBUG = false; -urbit + # See https://github.com/NixOS/nixpkgs/issues/18995 + hardeningDisable = lib.optionals enableDebug [ "all" ]; + + inherit enableParallelBuilding doCheck; + + meta = { debug = enableDebug; }; +} diff --git a/nix/pkgs/urbit/libsigsegv_fix.patch b/nix/pkgs/urbit/libsigsegv_fix.patch deleted file mode 100644 index 3f69cef520..0000000000 --- a/nix/pkgs/urbit/libsigsegv_fix.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/src/fault-linux-i386.h 2020-06-25 23:46:02.099235491 +0000 -+++ b/src/fault-linux-i386.h 2020-06-25 23:45:48.679156892 +0000 -@@ -18,6 +18,7 @@ - - #include "fault-posix-ucontext.h" - -+#define HAVE_STACKVMA 0 - #if defined __x86_64__ - /* 64 bit registers */ - ---- a/src/fault-linux-arm.h -+++ b/src/fault-linux-arm.h -@@ -17,6 +17,7 @@ - - #include "fault-posix-ucontext.h" - -+#define HAVE_STACKVMA 0 - #if defined(__aarch64__) || defined(__ARM_64BIT_STATE) || defined(__ARM_PCS_AAPCS64) /* 64-bit */ - - /* See glibc/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h. diff --git a/nix/pkgs/urbit/release.nix b/nix/pkgs/urbit/release.nix deleted file mode 100644 index 9d486f3dfd..0000000000 --- a/nix/pkgs/urbit/release.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ env_name, env, deps }: - -{ - ent, - name ? "urbit", - debug ? false, - ge-additions, - libaes_siv -}: - -let - - crossdeps = - with env; - [ curl libgmp libsigsegv openssl zlib lmdb ]; - - vendor = - with deps; - [ argon2 softfloat3 ed25519 ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ]; - -in - -env.make_derivation { - CFLAGS = if debug then "-O0 -g" else "-O3 -g"; - # binary stripping disabled - # LDFLAGS = if debug then "" else "-s"; - MEMORY_DEBUG = debug; - CPU_DEBUG = debug; - EVENT_TIME_DEBUG = false; - - name = "${name}-${env_name}"; - exename = name; - src = ../../../pkg/urbit; - cross_inputs = crossdeps ++ vendor ++ [ ent ]; - builder = ./release.sh; -} diff --git a/nix/pkgs/urbit/release.sh b/nix/pkgs/urbit/release.sh deleted file mode 100644 index 4bff817e42..0000000000 --- a/nix/pkgs/urbit/release.sh +++ /dev/null @@ -1,21 +0,0 @@ -source $setup - -cp -r $src ./src -chmod -R u+w ./src -cd src - -for dep in $cross_inputs; do - export CFLAGS="${CFLAGS-} -I$dep/include" - export LDFLAGS="${LDFLAGS-} -L$dep/lib" -done - -CC=$host-gcc \ -PKG_CONFIG=pkg-config-cross \ -HOST=$host \ -bash ./configure - -make build/urbit build/urbit-worker -j8 - -mkdir -p $out/bin -cp ./build/urbit $out/bin/$exename -cp ./build/urbit-worker $out/bin/$exename-worker diff --git a/nix/pkgs/urbit/shell.nix b/nix/pkgs/urbit/shell.nix deleted file mode 100644 index dee99d9620..0000000000 --- a/nix/pkgs/urbit/shell.nix +++ /dev/null @@ -1,16 +0,0 @@ -let - - pkgs = import ../../nixpkgs.nix; - deps = import ../../deps { inherit pkgs; }; - tlon = import ../../pkgs { inherit pkgs; }; - -in - -import ./default.nix { - inherit pkgs; - debug = false; - inherit (tlon) - ent ge-additions libaes_siv; - inherit (deps) - argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ivory-header ca-header; -} diff --git a/nix/release.nix b/nix/release.nix deleted file mode 100644 index 2ccd1098bc..0000000000 --- a/nix/release.nix +++ /dev/null @@ -1,54 +0,0 @@ -let - - nixpkgs = import ./nixpkgs.nix; - nixcrpkgs = import ./nixcrpkgs.nix; - crossdeps = import ./crossdeps.nix; - - release = - env_name: env: { - inherit env env_name; - deps = crossdeps env; - }; - - linux64 = release "linux64" nixcrpkgs.linux64; - darwin = release "darwin" nixcrpkgs.mac; - - ent = env: - import ./pkgs/ent/cross.nix env; - - ge-additions = env: - import ./pkgs/ge-additions/cross.nix env; - - libaes_siv = env: - import ./pkgs/libaes_siv/cross.nix env; - - urbit = { env, debug }: - import ./pkgs/urbit/release.nix env { - inherit debug; - name = if debug then "urbit-debug" else "urbit"; - ent = ent env; - ge-additions = ge-additions env; - libaes_siv = libaes_siv env; - }; - - builds-for-platform = plat: - plat.deps // { - inherit (plat.env) curl libgmp libsigsegv openssl zlib lmdb; - inherit (plat.env) cmake_toolchain; - ent = ent plat; - ge-additions = ge-additions plat; - libaes_siv = libaes_siv plat; - urbit = urbit { env = plat; debug = false; }; - urbit-debug = urbit { env = plat; debug = true; }; - }; - - darwin_extra = { - inherit (darwin.env) ranlib ld sdk ar toolchain tapi strip; - }; - -in - -{ - linux64 = builds-for-platform linux64; - darwin = darwin_extra // builds-for-platform darwin; -} diff --git a/nix/sources.json b/nix/sources.json new file mode 100644 index 0000000000..abe295cd04 --- /dev/null +++ b/nix/sources.json @@ -0,0 +1,134 @@ +{ + "argon2u": { + "branch": "master", + "description": "With argon2u. Based off https://github.com/P-H-C/phc-winner-argon2", + "homepage": "", + "owner": "urbit", + "repo": "argon2", + "rev": "4da94a611ee62bad87ab2b131ffda3bcc0723d9c", + "sha256": "0bqq1hg367l4jkb6cqhxlblpvdbwz3l586qsfakwzfd9wdvnm3yc", + "type": "tarball", + "url": "https://github.com/urbit/argon2/archive/4da94a611ee62bad87ab2b131ffda3bcc0723d9c.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "ed25519": { + "branch": "master", + "description": "Submodule included by Urbit", + "homepage": null, + "owner": "urbit", + "repo": "ed25519", + "rev": "76385f2ebbbc9580a9c236952d68d11d73a6135c", + "sha256": "0s1spif4s9lgcwcny3fl2fvpbw6acqn3s8r6qxnrmkd9icgyw4cp", + "type": "tarball", + "url": "https://github.com/urbit/ed25519/archive/76385f2ebbbc9580a9c236952d68d11d73a6135c.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "h2o": { + "branch": "master", + "description": "H2O - the optimized HTTP/1, HTTP/2, HTTP/3 server", + "homepage": "https://h2o.examp1e.net", + "owner": "h2o", + "repo": "h2o", + "rev": "v2.2.4", + "sha256": "0176x0bzjry19zs074a9i5vhncc842xikmx43wj61jky318nq4w4", + "type": "tarball", + "url": "https://github.com/h2o/h2o/archive/v2.2.4.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "hackage.nix": { + "branch": "master", + "description": "Automatically generated Nix expressions for Hackage", + "homepage": "", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "ed4d2759c9e6ca8133a4170f99fabdd76f30f51a", + "sha256": "1n5fk8zsxnbca96zk4ikh74iz3lzh35m302q65zk1rx3nmy4027d", + "type": "tarball", + "url": "https://github.com/input-output-hk/hackage.nix/archive/ed4d2759c9e6ca8133a4170f99fabdd76f30f51a.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "haskell.nix": { + "branch": "master", + "description": "Alternative Haskell Infrastructure for Nixpkgs", + "homepage": "https://input-output-hk.github.io/haskell.nix", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "bbb34dcdf7b90d478002f91713531f418ddf1b53", + "sha256": "1qq397j8vnlp5npk8r675fzjfimg74fcvrkxcdgx7vj48315bh2w", + "type": "tarball", + "url": "https://github.com/input-output-hk/haskell.nix/archive/bbb34dcdf7b90d478002f91713531f418ddf1b53.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "libscrypt": { + "branch": "master", + "description": null, + "homepage": null, + "owner": "urbit", + "repo": "libscrypt", + "rev": "029693ff1cbe4f69d3a2da87d0f4f034f92cc0c2", + "sha256": "17pcxypzjmmrvacw45cacvibm6mlr9ip30hy30l1appsnywx679n", + "type": "tarball", + "url": "https://github.com/urbit/libscrypt/archive/029693ff1cbe4f69d3a2da87d0f4f034f92cc0c2.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "murmur3": { + "branch": "master", + "description": null, + "homepage": null, + "owner": "urbit", + "repo": "murmur3", + "rev": "71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca", + "sha256": "0k7jq2nb4ad9ajkr6wc4w2yy2f2hkwm3nkbj2pklqgwsg6flxzwg", + "type": "tarball", + "url": "https://github.com/urbit/murmur3/archive/71a75d57ca4e7ca0f7fc2fd84abd93595b0624ca.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "niv": { + "branch": "master", + "description": "Easy dependency management for Nix projects", + "homepage": "https://github.com/nmattia/niv", + "owner": "nmattia", + "repo": "niv", + "rev": "9d35b9e4837ab88517210b1701127612c260eccf", + "sha256": "0q50xhnm8g2yfyakrh0nly4swyygxpi0a8cb9gp65wcakcgvzvdh", + "type": "tarball", + "url": "https://github.com/nmattia/niv/archive/9d35b9e4837ab88517210b1701127612c260eccf.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs": { + "branch": "master", + "description": "Nix Packages collection", + "homepage": null, + "owner": "nixos", + "repo": "nixpkgs", + "rev": "166ab9d237409c4b74b1f8ca31476ead35e8fe53", + "sha256": "13i43kvbkdl3dh8b986j6mxbn355mqjhcxrd8cni8zfx1z0wrscr", + "type": "tarball", + "url": "https://github.com/nixos/nixpkgs/archive/166ab9d237409c4b74b1f8ca31476ead35e8fe53.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "softfloat3": { + "branch": "master", + "description": null, + "homepage": null, + "owner": "urbit", + "repo": "berkeley-softfloat-3", + "rev": "ec4c7e31b32e07aad80e52f65ff46ac6d6aad986", + "sha256": "1lz4bazbf7lns1xh8aam19c814a4n4czq5xsq5rmi9sgqw910339", + "type": "tarball", + "url": "https://github.com/urbit/berkeley-softfloat-3/archive/ec4c7e31b32e07aad80e52f65ff46ac6d6aad986.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "stackage.nix": { + "branch": "master", + "description": "Automatically generated Nix expressions of Stackage snapshots", + "homepage": "", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "08312f475f4f5f3b6578e7a78dc501de6fea8792", + "sha256": "15j1l6616kfv7351jxwgb9kj6y8227fcm87nxwabmbn1q6a8q2kf", + "type": "tarball", + "url": "https://github.com/input-output-hk/stackage.nix/archive/08312f475f4f5f3b6578e7a78dc501de6fea8792.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} diff --git a/nix/sources.nix b/nix/sources.nix new file mode 100644 index 0000000000..0286dec14a --- /dev/null +++ b/nix/sources.nix @@ -0,0 +1,154 @@ +# This file has been generated by Niv. + +let + + # + # The fetchers. fetch_ fetches specs of type . + # + + fetch_file = pkgs: spec: + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; } + else + pkgs.fetchurl { inherit (spec) url sha256; }; + + fetch_tarball = pkgs: name: spec: + let + ok = str: !builtins.isNull (builtins.match "[a-zA-Z0-9+-._?=]" str); + # sanitize the name, though nix will still fail if name starts with period + name' = stringAsChars (x: if !ok x then "-" else x) "${name}-src"; + in if spec.builtin or true then + builtins_fetchTarball { + name = name'; + inherit (spec) url sha256; + } + else + pkgs.fetchzip { + name = name'; + inherit (spec) url sha256; + }; + + fetch_git = spec: + builtins.fetchGit { + url = spec.repo; + inherit (spec) rev ref; + }; + + fetch_local = spec: spec.path; + + fetch_builtin-tarball = name: + throw '' + [${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=tarball -a builtin=true''; + + fetch_builtin-url = name: + throw '' + [${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=file -a builtin=true''; + + # + # Various helpers + # + + # The set of packages used when specs are fetched using non-builtins. + mkPkgs = sources: + let + sourcesNixpkgs = + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) + { }; + hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; + hasThisAsNixpkgsPath = == ./.; + in if builtins.hasAttr "nixpkgs" sources then + sourcesNixpkgs + else if hasNixpkgsPath && !hasThisAsNixpkgsPath then + import { } + else + abort '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; + + # The actual fetching function. + fetch = pkgs: name: spec: + + if !builtins.hasAttr "type" spec then + abort "ERROR: niv spec ${name} does not have a 'type' attribute" + else if spec.type == "file" then + fetch_file pkgs spec + else if spec.type == "tarball" then + fetch_tarball pkgs name spec + else if spec.type == "git" then + fetch_git spec + else if spec.type == "local" then + fetch_local spec + else if spec.type == "builtin-tarball" then + fetch_builtin-tarball name + else if spec.type == "builtin-url" then + fetch_builtin-url name + else + abort + "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + + # Ports of functions for older nix versions + + # a Nix version of mapAttrs if the built-in doesn't exist + mapAttrs = builtins.mapAttrs or (f: set: + with builtins; + listToAttrs (map (attr: { + name = attr; + value = f attr set.${attr}; + }) (attrNames set))); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 + range = first: last: + if first > last then + [ ] + else + builtins.genList (n: first + n) (last - first + 1); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 + stringToCharacters = s: + map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 + stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); + concatStrings = builtins.concatStringsSep ""; + + # fetchTarball version that is compatible between all the versions of Nix + builtins_fetchTarball = { url, name, sha256 }@attrs: + let inherit (builtins) lessThan nixVersion fetchTarball; + in if lessThan nixVersion "1.12" then + fetchTarball { inherit name url; } + else + fetchTarball attrs; + + # fetchurl version that is compatible between all the versions of Nix + builtins_fetchurl = { url, sha256 }@attrs: + let inherit (builtins) lessThan nixVersion fetchurl; + in if lessThan nixVersion "1.12" then + fetchurl { inherit url; } + else + fetchurl attrs; + + # Create the final "sources" from the config + mkSources = config: + mapAttrs (name: spec: + if builtins.hasAttr "outPath" spec then + abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = fetch config.pkgs name spec; }) config.sources; + + # The "config" used by the fetchers + mkConfig = { sourcesFile ? ./sources.json + , sources ? builtins.fromJSON (builtins.readFile sourcesFile) + , pkgs ? mkPkgs sources }: rec { + # The sources, i.e. the attribute set of spec name to spec + inherit sources; + + # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers + inherit pkgs; + }; +in mkSources (mkConfig { }) // { + __functor = _: settings: mkSources (mkConfig settings); +} diff --git a/pkg/ent/shell.nix b/pkg/ent/shell.nix new file mode 100644 index 0000000000..0866cb96f2 --- /dev/null +++ b/pkg/ent/shell.nix @@ -0,0 +1,8 @@ +let + + pkgs = import ../../default.nix { }; + +in pkgs.shellFor { + name = "ent"; + packages = ps: [ ps.ent ]; +} diff --git a/pkg/ge-additions/shell.nix b/pkg/ge-additions/shell.nix new file mode 100644 index 0000000000..4e07f72b5b --- /dev/null +++ b/pkg/ge-additions/shell.nix @@ -0,0 +1,8 @@ +let + + pkgs = import ../../default.nix { }; + +in pkgs.shellFor { + name = "ge-additions"; + packages = ps: [ ps.ge-additions ]; +} diff --git a/pkg/herb/default.nix b/pkg/herb/default.nix deleted file mode 100644 index b1dd819a6a..0000000000 --- a/pkg/herb/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -let - - rev = "61c3169a0e17d789c566d5b241bfe309ce4a6275"; - hash = "0qbycg7wkb71v20rchlkafrjfpbk2fnlvvbh3ai9pyfisci5wxvq"; - - nixpkgs = builtins.fetchTarball { - name = "nixpkgs-2019-01-15"; - url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz"; - sha256 = hash; - }; - -in - -{ pkgs ? import nixpkgs {} }: - -let - - pyenv = pkgs.python2.withPackages (py: [ py.requests ]); - pyexe = "${pyenv}/bin/python"; - -in - -pkgs.stdenv.mkDerivation rec { - name = "herb"; - buildInputs = [ pyenv ]; - unpackPhase = "true"; - installPhase = '' - mkdir -p $out/bin - - cp ${./herb} $out/bin/herb.py - - cat > $out/bin/herb < {} }: -with pkgs; -stdenv.mkDerivation { +let + + pkgs = import ../../default.nix { }; + +in pkgs.shellFor { name = "libaes_siv"; - buildInputs = [ cmake openssl ]; + packages = ps: [ ps.libaes_siv ]; } diff --git a/pkg/urbit/shell.nix b/pkg/urbit/shell.nix index 6974e63c9e..62e0f72cd0 100644 --- a/pkg/urbit/shell.nix +++ b/pkg/urbit/shell.nix @@ -1 +1,8 @@ -import ../../nix/pkgs/urbit/shell.nix +let + + pkgs = import ../../default.nix { }; + +in pkgs.shellFor { + name = "urbit"; + packages = ps: [ ps.urbit ]; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000000..184b9d9f00 --- /dev/null +++ b/shell.nix @@ -0,0 +1,72 @@ +# A repository wide shell.nix containing all tools, formatters, and inputs +# required to build any of the C or Haskell packages. +# +# Entering a nix-shell using this derivation will allow you to cd anywhere +# in the ./pkg directory and run the appropriate build tooling. +# +# See the individual ./pkg/* directories for shell.nix derivations that only +# propagate minimal sets of buildInputs for the related package. +# (import ./default.nix { }).shell + +let + + pkgs = import ./nix/default.nix { }; + localPackages = import ./default.nix { }; + + # The non-Haskell packages which build inputs (dependencies) will be + # propagated into the shell. This combines nixpkgs' mkShell behaviour + # with Haskell.nix's shellFor. + # + # For example, adding urbit here results in gmp, h2o, zlib, etc. being + # made available, so you can just run make. + # + # Typically the inputs listed here also have a shell.nix in their respective + # source directory you can use, to avoid the Haskell/GHC dependencies. + inputsFrom = with localPackages; [ ent ge-additions herb libaes_siv urbit ]; + + merge = name: pkgs.lib.concatLists (pkgs.lib.catAttrs name inputsFrom); + +in localPackages.hs.shellFor { + # Haskell packages from the stackProject which will have their + # dependencies available in the shell. + packages = ps: + with ps; [ + lmdb-static + racquire + terminal-progress-bar + urbit-atom + urbit-azimuth + urbit-eventlog-lmdb + urbit-king + urbit-noun + urbit-noun-core + urbit-termsize + ]; + + # Build tools to make available in the shell's PATH. + buildInputs = [ + pkgs.cacert + pkgs.stack + pkgs.nixfmt + pkgs.shfmt + + (import pkgs.sources.niv { }).niv + + (localPackages.hs.hackageTool { + name = "ormolu"; + version = "0.1.3.0"; + }) + + (localPackages.hs.hackageTool { + name = "ShellCheck"; + version = "0.7.1"; + }) + ] ++ merge "buildInputs"; + + nativeBuildInputs = merge "nativeBuildInputs"; + propagatedBuildInputs = merge "propagatedBuildInputs"; + propagatedNativeBuildInputs = merge "propagatedNativeBuildInputs"; + + shellHook = pkgs.lib.concatStringsSep "\n" + (pkgs.lib.catAttrs "shellHook" (pkgs.lib.reverseList inputsFrom)); +}