diff options
author | Austin Seipp <aseipp@pobox.com> | 2019-05-12 13:21:41 -0500 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2019-05-15 09:54:10 -0500 |
commit | a13a0c8de447cd77e9b922ee12e700824b855ce0 (patch) | |
tree | ae68498f8f7cbf0f4bfe85cdc70a6b31d7374af9 /pkgs/servers | |
parent | 34e15b1c73553e958d8357681f6fb8ff8711646c (diff) |
foundationdb: refactor vsmake patch application
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'pkgs/servers')
-rw-r--r-- | pkgs/servers/foundationdb/default.nix | 39 | ||||
-rw-r--r-- | pkgs/servers/foundationdb/patches/fix-scm-version.patch (renamed from pkgs/servers/foundationdb/fix-scm-version.patch) | 0 | ||||
-rw-r--r-- | pkgs/servers/foundationdb/patches/ldflags-5.1.patch (renamed from pkgs/servers/foundationdb/ldflags-5.1.patch) | 0 | ||||
-rw-r--r-- | pkgs/servers/foundationdb/patches/ldflags-5.2.patch (renamed from pkgs/servers/foundationdb/ldflags-5.2.patch) | 0 | ||||
-rw-r--r-- | pkgs/servers/foundationdb/patches/ldflags-6.0.patch (renamed from pkgs/servers/foundationdb/ldflags-6.0.patch) | 0 | ||||
-rw-r--r-- | pkgs/servers/foundationdb/vsmake.nix | 32 |
6 files changed, 39 insertions, 32 deletions
diff --git a/pkgs/servers/foundationdb/default.nix b/pkgs/servers/foundationdb/default.nix index f6a6329adb500..b9b091f8476e7 100644 --- a/pkgs/servers/foundationdb/default.nix +++ b/pkgs/servers/foundationdb/default.nix @@ -6,23 +6,54 @@ }@args: let - vsmake = import ./vsmake.nix args; + vsmakeBuild = import ./vsmake.nix args; + + python3-six-patch = fetchpatch { + name = "update-python-six.patch"; + url = "https://github.com/apple/foundationdb/commit/4bd9efc4fc74917bc04b07a84eb065070ea7edb2.patch"; + sha256 = "030679lmc86f1wzqqyvxnwjyfrhh54pdql20ab3iifqpp9i5mi85"; + }; + + python3-print-patch = fetchpatch { + name = "import-for-python-print.patch"; + url = "https://github.com/apple/foundationdb/commit/ded17c6cd667f39699cf663c0e87fe01e996c153.patch"; + sha256 = "11y434w68cpk7shs2r22hyrpcrqi8vx02cw7v5x79qxvnmdxv2an"; + }; + in with builtins; { - foundationdb51 = vsmake rec { + foundationdb51 = vsmakeBuild rec { version = "5.1.7"; branch = "release-5.1"; sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06"; + + patches = [ + ./patches/ldflags-5.1.patch + ./patches/fix-scm-version.patch + python3-six-patch + python3-print-patch + ]; }; - foundationdb52 = vsmake rec { + foundationdb52 = vsmakeBuild rec { version = "5.2.8"; branch = "release-5.2"; sha256 = "1kbmmhk2m9486r4kyjlc7bb3wd50204i0p6dxcmvl6pbp1bs0wlb"; + + patches = [ + ./patches/ldflags-5.2.patch + ./patches/fix-scm-version.patch + python3-six-patch + python3-print-patch + ]; }; - foundationdb60 = vsmake rec { + foundationdb60 = vsmakeBuild rec { version = "6.0.18"; branch = "release-6.0"; sha256 = "0q1mscailad0z7zf1nypv4g7gx3damfp45nf8nzyq47nsw5gz69p"; + + patches = [ + ./patches/ldflags-6.0.patch + ]; }; } diff --git a/pkgs/servers/foundationdb/fix-scm-version.patch b/pkgs/servers/foundationdb/patches/fix-scm-version.patch index 0e0df7ade82b1..0e0df7ade82b1 100644 --- a/pkgs/servers/foundationdb/fix-scm-version.patch +++ b/pkgs/servers/foundationdb/patches/fix-scm-version.patch diff --git a/pkgs/servers/foundationdb/ldflags-5.1.patch b/pkgs/servers/foundationdb/patches/ldflags-5.1.patch index 4d523a7ecdd3d..4d523a7ecdd3d 100644 --- a/pkgs/servers/foundationdb/ldflags-5.1.patch +++ b/pkgs/servers/foundationdb/patches/ldflags-5.1.patch diff --git a/pkgs/servers/foundationdb/ldflags-5.2.patch b/pkgs/servers/foundationdb/patches/ldflags-5.2.patch index ee5911e495f8b..ee5911e495f8b 100644 --- a/pkgs/servers/foundationdb/ldflags-5.2.patch +++ b/pkgs/servers/foundationdb/patches/ldflags-5.2.patch diff --git a/pkgs/servers/foundationdb/ldflags-6.0.patch b/pkgs/servers/foundationdb/patches/ldflags-6.0.patch index 1fa17a9615aa9..1fa17a9615aa9 100644 --- a/pkgs/servers/foundationdb/ldflags-6.0.patch +++ b/pkgs/servers/foundationdb/patches/ldflags-6.0.patch diff --git a/pkgs/servers/foundationdb/vsmake.nix b/pkgs/servers/foundationdb/vsmake.nix index c782e0e98313d..a834f04a08636 100644 --- a/pkgs/servers/foundationdb/vsmake.nix +++ b/pkgs/servers/foundationdb/vsmake.nix @@ -1,8 +1,7 @@ # This builder is for FoundationDB's original, somewhat strange visual studio + # make build system. In FoundationDB 6.1 and later, there's a new CMake system # (which will eventually become the default version.) -{ stdenv49 -, lib, fetchurl, fetchpatch, fetchFromGitHub +{ stdenv49, lib, fetchurl, fetchFromGitHub , which, findutils, m4, gawk , python, openjdk, mono, libressl @@ -43,6 +42,8 @@ let # if an release is unofficial/a prerelease, then make sure this is set , officialRelease ? true + + , patches ? [] }: stdenv.mkDerivation rec { name = "foundationdb-${version}"; inherit version; @@ -56,32 +57,7 @@ let nativeBuildInputs = [ python openjdk gawk which m4 findutils mono ]; buildInputs = [ libressl boost ]; - patches = - [ # For 5.2+, we need a slightly adjusted patch to fix all the ldflags - (if lib.versionAtLeast version "5.2" - then (if lib.versionAtLeast version "6.0" - then ./ldflags-6.0.patch - else ./ldflags-5.2.patch) - else ./ldflags-5.1.patch) - ] - # for 6.0+, we do NOT need to apply this version fix, since we can specify - # it ourselves. see configurePhase - ++ (lib.optional (!lib.versionAtLeast version "6.0") ./fix-scm-version.patch) - # Versions less than 6.0 have a busted Python 3 build due to an outdated - # use of 'print'. Also apply an update to the six module with many bugfixes, - # which is in 6.0+ as well - ++ (lib.optional (!lib.versionAtLeast version "6.0") (fetchpatch { - name = "update-python-six.patch"; - url = "https://github.com/apple/foundationdb/commit/4bd9efc4fc74917bc04b07a84eb065070ea7edb2.patch"; - sha256 = "030679lmc86f1wzqqyvxnwjyfrhh54pdql20ab3iifqpp9i5mi85"; - })) - ++ (lib.optional (!lib.versionAtLeast version "6.0") (fetchpatch { - name = "import-for-python-print.patch"; - url = "https://github.com/apple/foundationdb/commit/ded17c6cd667f39699cf663c0e87fe01e996c153.patch"; - sha256 = "11y434w68cpk7shs2r22hyrpcrqi8vx02cw7v5x79qxvnmdxv2an"; - })) - ; - + inherit patches; postPatch = '' # note: this does not do anything for 6.0+ substituteInPlace ./build/scver.mk \ |