From d6e0169c6f2d7ea040e61c41cbaa8f5d074f6b2b Mon Sep 17 00:00:00 2001 From: Robin Bate Boerop Date: Sun, 15 Mar 2015 09:59:41 -0400 Subject: [PATCH 1/5] Add Sqitch database management tool --- .../development/tools/misc/sqitch/default.nix | 21 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 +++++ pkgs/top-level/perl-packages.nix | 5 +++++ 3 files changed, 31 insertions(+) create mode 100644 pkgs/development/tools/misc/sqitch/default.nix diff --git a/pkgs/development/tools/misc/sqitch/default.nix b/pkgs/development/tools/misc/sqitch/default.nix new file mode 100644 index 000000000000..dcf0710c5d32 --- /dev/null +++ b/pkgs/development/tools/misc/sqitch/default.nix @@ -0,0 +1,21 @@ +{ stdenv, writeScript, makeWrapper, sqitchModule }: +stdenv.mkDerivation rec { + name = "sqitch-0.999"; + buildInputs = [ makeWrapper ]; + propagatedNativeBuildInputs = [ sqitchModule ]; + builder = writeScript (name + "-builder.sh") '' + . ${stdenv}/setup + mkdir -p $out/bin + cp ${sqitchModule}/bin/sqitch $out/bin + fixupPhase + wrapProgram $out/bin/sqitch \ + --prefix PERL5LIB : \ + "$(for i in "$propagatedNativeBuildInputs" ; do + for j in $(cat $i/nix-support/propagated-native-build-inputs) ; do + echo -n "$j"/lib/perl5/site_perl: + done + done + echo "$propagatedNativeBuildInputs"/lib/perl5/site_perl + )" + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c01976f84cd4..1c0c012ba93c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7816,6 +7816,11 @@ let planetary_annihilation = callPackage ../games/planetaryannihilation { }; + sqitch = callPackage ../development/tools/misc/sqitch { + inherit stdenv writeScript makeWrapper ; + sqitchModule = perlPackages.AppSqitch; + }; + ### DEVELOPMENT / PYTHON MODULES # python function with default python interpreter diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index ab01e9b1f489..23077aed55a5 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -235,6 +235,11 @@ let self = _self // overrides; _self = with self; { IPCSystemSimple ListMoreUtils Moo PathClass PerlIOutf8_strict StringFormatter StringShellQuote SubExporter TemplateTiny Throwable TryTiny TypeTiny URI URIdb libintlperl namespaceautoclean + strictures ModuleRuntime DevelGlobalDestruction SubExporterProgressive + ImportInto ExporterTiny DataOptList ParamsUtil SubInstall RoleTiny + MooXTypesMooseLike ClassLoad ModuleImplementation ClassLoadXS + BHooksEndOfScope namespaceclean PackageStash SubIdentify + ClassMethodModifiers ]; doCheck = false; # Can't find home directory. meta = { From d73e5d6fbceb8fb7cc055aacf421d955b417c754 Mon Sep 17 00:00:00 2001 From: Robin Bate Boerop Date: Sun, 15 Mar 2015 11:06:01 -0400 Subject: [PATCH 2/5] Handle Sqitch manual --- pkgs/development/tools/misc/sqitch/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/misc/sqitch/default.nix b/pkgs/development/tools/misc/sqitch/default.nix index dcf0710c5d32..bef21abc0f07 100644 --- a/pkgs/development/tools/misc/sqitch/default.nix +++ b/pkgs/development/tools/misc/sqitch/default.nix @@ -6,7 +6,9 @@ stdenv.mkDerivation rec { builder = writeScript (name + "-builder.sh") '' . ${stdenv}/setup mkdir -p $out/bin - cp ${sqitchModule}/bin/sqitch $out/bin + for d in bin/sqitch etc lib share ; do + ln -s ${sqitchModule}/$d $out/$d + done fixupPhase wrapProgram $out/bin/sqitch \ --prefix PERL5LIB : \ From 566cd9ba19fe9fcc4ea87accf9f99edb2c901392 Mon Sep 17 00:00:00 2001 From: Robin Bate Boerop Date: Tue, 17 Mar 2015 09:46:52 -0300 Subject: [PATCH 3/5] Remove unnecessary propagatedBuildInputs line --- pkgs/development/tools/misc/sqitch/default.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/misc/sqitch/default.nix b/pkgs/development/tools/misc/sqitch/default.nix index bef21abc0f07..c4c8e065bc55 100644 --- a/pkgs/development/tools/misc/sqitch/default.nix +++ b/pkgs/development/tools/misc/sqitch/default.nix @@ -2,7 +2,6 @@ stdenv.mkDerivation rec { name = "sqitch-0.999"; buildInputs = [ makeWrapper ]; - propagatedNativeBuildInputs = [ sqitchModule ]; builder = writeScript (name + "-builder.sh") '' . ${stdenv}/setup mkdir -p $out/bin @@ -12,12 +11,10 @@ stdenv.mkDerivation rec { fixupPhase wrapProgram $out/bin/sqitch \ --prefix PERL5LIB : \ - "$(for i in "$propagatedNativeBuildInputs" ; do - for j in $(cat $i/nix-support/propagated-native-build-inputs) ; do - echo -n "$j"/lib/perl5/site_perl: - done + "$(for i in $(cat ${sqitchModule}/nix-support/propagated-native-build-inputs) ; do + echo -n "$i"/lib/perl5/site_perl: done - echo "$propagatedNativeBuildInputs"/lib/perl5/site_perl + echo ${sqitchModule}/lib/perl5/site_perl )" ''; } From a3a98d724220ef5e6577d726055cf4c993ce31a8 Mon Sep 17 00:00:00 2001 From: Robin Bate Boerop Date: Wed, 18 Mar 2015 10:32:46 -0300 Subject: [PATCH 4/5] Improved builder for Sqitch --- .../development/tools/misc/sqitch/default.nix | 23 ++++++++----------- pkgs/top-level/all-packages.nix | 6 +++-- pkgs/top-level/perl-packages.nix | 15 ++++++------ 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/pkgs/development/tools/misc/sqitch/default.nix b/pkgs/development/tools/misc/sqitch/default.nix index c4c8e065bc55..0a1032cecf81 100644 --- a/pkgs/development/tools/misc/sqitch/default.nix +++ b/pkgs/development/tools/misc/sqitch/default.nix @@ -1,20 +1,15 @@ -{ stdenv, writeScript, makeWrapper, sqitchModule }: -stdenv.mkDerivation rec { - name = "sqitch-0.999"; - buildInputs = [ makeWrapper ]; - builder = writeScript (name + "-builder.sh") '' - . ${stdenv}/setup +{ name, stdenv, perl, makeWrapper, sqitchModule, databaseModule }: +stdenv.mkDerivation { + name = "${name}-${sqitchModule.version}"; + buildInputs = [ perl makeWrapper sqitchModule databaseModule ]; + unpackPhase = ":"; + buildPhase = ":"; + installPhase = '' mkdir -p $out/bin for d in bin/sqitch etc lib share ; do ln -s ${sqitchModule}/$d $out/$d done - fixupPhase - wrapProgram $out/bin/sqitch \ - --prefix PERL5LIB : \ - "$(for i in $(cat ${sqitchModule}/nix-support/propagated-native-build-inputs) ; do - echo -n "$i"/lib/perl5/site_perl: - done - echo ${sqitchModule}/lib/perl5/site_perl - )" ''; + dontStrip = true; + postFixup = "wrapProgram $out/bin/sqitch --prefix PERL5LIB : $PERL5LIB"; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1c0c012ba93c..437ec5b1ce0e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7816,8 +7816,10 @@ let planetary_annihilation = callPackage ../games/planetaryannihilation { }; - sqitch = callPackage ../development/tools/misc/sqitch { - inherit stdenv writeScript makeWrapper ; + sqitchPg = callPackage ../development/tools/misc/sqitch { + inherit stdenv perl makeWrapper; + name = "sqitch-pg"; + databaseModule = perlPackages.DBDPg; sqitchModule = perlPackages.AppSqitch; }; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 23077aed55a5..a96b05bd998c 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -219,8 +219,9 @@ let self = _self // overrides; _self = with self; { }; }; - AppSqitch = buildPerlModule { - name = "App-Sqitch-0.999"; + AppSqitch = buildPerlModule rec { + version = "0.999"; + name = "App-Sqitch-${version}"; src = fetchurl { url = mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-0.999.tar.gz; sha256 = "e7e02194a7b0c42fb4df046cd834d5eb99ff9a2c169f5c60a52c362e89351da6"; @@ -235,11 +236,11 @@ let self = _self // overrides; _self = with self; { IPCSystemSimple ListMoreUtils Moo PathClass PerlIOutf8_strict StringFormatter StringShellQuote SubExporter TemplateTiny Throwable TryTiny TypeTiny URI URIdb libintlperl namespaceautoclean - strictures ModuleRuntime DevelGlobalDestruction SubExporterProgressive - ImportInto ExporterTiny DataOptList ParamsUtil SubInstall RoleTiny - MooXTypesMooseLike ClassLoad ModuleImplementation ClassLoadXS - BHooksEndOfScope namespaceclean PackageStash SubIdentify - ClassMethodModifiers + # strictures ModuleRuntime DevelGlobalDestruction SubExporterProgressive + # ImportInto ExporterTiny DataOptList ParamsUtil SubInstall RoleTiny + # MooXTypesMooseLike ClassLoad ModuleImplementation ClassLoadXS + # BHooksEndOfScope namespaceclean PackageStash SubIdentify + # ClassMethodModifiers ]; doCheck = false; # Can't find home directory. meta = { From 63d54cf5b75ea6921cea70c97b1632278538af4a Mon Sep 17 00:00:00 2001 From: Robin Bate Boerop Date: Thu, 19 Mar 2015 09:02:46 -0300 Subject: [PATCH 5/5] Remove unnecessary propagatedNativeBuildInputs from AppSqitch --- pkgs/top-level/perl-packages.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index a96b05bd998c..ef3f24090412 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -236,11 +236,6 @@ let self = _self // overrides; _self = with self; { IPCSystemSimple ListMoreUtils Moo PathClass PerlIOutf8_strict StringFormatter StringShellQuote SubExporter TemplateTiny Throwable TryTiny TypeTiny URI URIdb libintlperl namespaceautoclean - # strictures ModuleRuntime DevelGlobalDestruction SubExporterProgressive - # ImportInto ExporterTiny DataOptList ParamsUtil SubInstall RoleTiny - # MooXTypesMooseLike ClassLoad ModuleImplementation ClassLoadXS - # BHooksEndOfScope namespaceclean PackageStash SubIdentify - # ClassMethodModifiers ]; doCheck = false; # Can't find home directory. meta = {