From 7b21e19a82b89ac5fa704fac005abee7d63cadfc Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Mon, 3 Jun 2013 22:08:57 +0200 Subject: [PATCH] git-annex: generate build instructions with cabal2nix --- .../git-and-tools/default.nix | 12 +- .../git-and-tools/git-annex/default.nix | 110 ++++++++---------- pkgs/top-level/haskell-packages.nix | 2 + 3 files changed, 50 insertions(+), 74 deletions(-) diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix index a5aeb1bf6a4..fe5aebeb96e 100644 --- a/pkgs/applications/version-management/git-and-tools/default.nix +++ b/pkgs/applications/version-management/git-and-tools/default.nix @@ -42,17 +42,7 @@ rec { sendEmailSupport = !stdenv.isDarwin; }); - gitAnnex = lib.makeOverridable (import ./git-annex) { - inherit stdenv fetchurl perl which ikiwiki curl bup git gnupg1 lsof openssh rsync; - inherit (haskellPackages) ghc aeson async blazeBuilder bloomfilter - caseInsensitive clientsession cryptoApi dataDefault dataenc DAV dbus dns - editDistance extensibleExceptions filepath gnutls hamlet hinotify hS3 - hslogger httpConduit httpTypes HUnit IfElse json liftedBase MissingH - monadControl mtl network networkInfo networkMulticast networkProtocolXmpp - QuickCheck random regexCompat SafeSemaphore SHA stm text time regexTdfa - transformers transformersBase utf8String uuid wai waiLogger warp - xmlConduit xmlTypes yesod yesodDefault yesodForm yesodStatic; - }; + gitAnnex = pkgs.haskellPackages.gitAnnex; qgit = import ./qgit { inherit fetchurl stdenv; diff --git a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix index 7e8b57293b7..5086f4f31b3 100644 --- a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix @@ -1,73 +1,57 @@ -{ stdenv, fetchurl, perl, which, ikiwiki, ghc, aeson, async, blazeBuilder -, bloomfilter, bup, caseInsensitive, clientsession, cryptoApi, curl, dataDefault -, dataenc, DAV, dbus, dns, editDistance, extensibleExceptions, filepath, git -, gnupg1, gnutls, hamlet, hinotify, hS3, hslogger, httpConduit, httpTypes, HUnit -, IfElse, json, liftedBase, lsof, MissingH, monadControl, mtl, network -, networkInfo, networkMulticast, networkProtocolXmpp, openssh, QuickCheck -, random, regexCompat, rsync, SafeSemaphore, SHA, stm, text, time, transformers -, transformersBase, utf8String, uuid, wai, waiLogger, warp, xmlConduit, xmlTypes -, yesod, yesodDefault, yesodForm, yesodStatic, regexTdfa +{ cabal, aeson, async, blazeBuilder, bloomfilter, bup +, caseInsensitive, clientsession, cryptoApi, curl, dataDefault +, dataenc, DAV, dbus, dlist, dns, editDistance +, extensibleExceptions, filepath, git, gnupg1, gnutls, hamlet +, hinotify, hS3, hslogger, HTTP, httpConduit, httpTypes, HUnit +, IfElse, json, lsof, MissingH, MonadCatchIOTransformers +, monadControl, mtl, network, networkInfo, networkMulticast +, networkProtocolXmpp, openssh, QuickCheck, random, regexTdfa +, rsync, SafeSemaphore, SHA, stm, text, time, transformers +, unixCompat, utf8String, uuid, wai, waiLogger, warp, xmlConduit +, xmlTypes, yesod, yesodDefault, yesodForm, yesodStatic }: -let - version = "4.20130521"; -in -stdenv.mkDerivation { - name = "git-annex-${version}"; - - src = fetchurl { - url = "https://github.com/joeyh/git-annex/tarball/${version}"; - sha256 = "0wa3sgw0xbqykl5r6ba0gannwj61y0h024glm0xjj97fy06b77i0"; - name = "git-annex-${version}.tar.gz"; - }; - - buildInputs = [ ghc aeson async blazeBuilder bloomfilter bup ikiwiki - caseInsensitive clientsession cryptoApi curl dataDefault dataenc DAV dbus - dns editDistance extensibleExceptions filepath git gnupg1 gnutls hamlet - hinotify hS3 hslogger httpConduit httpTypes HUnit IfElse json liftedBase - lsof MissingH monadControl mtl network networkInfo networkMulticast - networkProtocolXmpp openssh QuickCheck random regexCompat rsync - SafeSemaphore SHA stm text time transformers transformersBase utf8String - uuid wai waiLogger warp xmlConduit xmlTypes yesod yesodDefault yesodForm - yesodStatic which perl regexTdfa ]; - - configurePhase = '' - makeFlagsArray=( PREFIX=$out CABAL=./Setup ) - patchShebangs . - ghc -O2 --make Setup - ./Setup configure -ftestsuite -f-android -fproduction -fdns -fxmpp -fpairing -f-webapp -fassistant -fdbus -finotify -fwebdav -fs3 - ''; - - doCheck = true; +cabal.mkDerivation (self: { + pname = "git-annex"; + version = "4.20130601"; + sha256 = "0l6jbi9r26w5h9hfg9v9qybqvijp4n7c9l1zd4ikxg2nqcc8j8ln"; + isLibrary = false; + isExecutable = true; + buildDepends = [ + aeson async blazeBuilder bloomfilter caseInsensitive clientsession + cryptoApi dataDefault dataenc DAV dbus dlist dns editDistance + extensibleExceptions filepath gnutls hamlet hinotify hS3 hslogger + HTTP httpConduit httpTypes HUnit IfElse json MissingH + MonadCatchIOTransformers monadControl mtl network networkInfo + networkMulticast networkProtocolXmpp QuickCheck random regexTdfa + SafeSemaphore SHA stm text time transformers unixCompat utf8String + uuid wai waiLogger warp xmlConduit xmlTypes yesod yesodDefault + yesodForm yesodStatic + ]; + buildTools = [ bup curl git gnupg1 lsof openssh rsync ]; + configureFlags = "-fS3 + -fWebDAV + -fInotify + -fDbus + -f-Assistant + -f-Webapp + -fPairing + -fXMPP + -fDNS + -fProduction + -fTDFA"; + preConfigure = "patchShebangs ."; checkPhase = '' export HOME="$NIX_BUILD_TOP/tmp" mkdir "$HOME" + cp dist/build/git-annex/git-annex git-annex ./git-annex test ''; - meta = { homepage = "http://git-annex.branchable.com/"; - description = "Manage files with git without checking them into git"; - license = stdenv.lib.licenses.gpl3Plus; - - longDescription = '' - Git-annex allows managing files with git, without checking the - file contents into git. While that may seem paradoxical, it is - useful when dealing with files larger than git can currently - easily handle, whether due to limitations in memory, checksumming - time, or disk space. - - Even without file content tracking, being able to manage files - with git, move files around and delete files with versioned - directory trees, and use branches and distributed clones, are all - very handy reasons to use git. And annexed files can co-exist in - the same git repository with regularly versioned files, which is - convenient for maintaining documents, Makefiles, etc that are - associated with annexed files but that benefit from full revision - control. - ''; - - platforms = ghc.meta.platforms; - maintainers = [ stdenv.lib.maintainers.simons ]; + description = "manage files with git, without checking their contents into git"; + license = "GPL"; + platforms = self.ghc.meta.platforms; + maintainers = [ self.stdenv.lib.maintainers.simons ]; }; -} +}) diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index b17eaeff626..acd91ee6f60 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -2258,6 +2258,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y); cabalInstall_1_16_0_2 = callPackage ../tools/package-management/cabal-install/1.16.0.2.nix {}; cabalInstall = self.cabalInstall_1_16_0_2; + gitAnnex = callPackage ../applications/version-management/git-and-tools/git-annex {}; + githubBackup = callPackage ../applications/version-management/git-and-tools/github-backup {}; jailbreakCabal = callPackage ../development/tools/haskell/jailbreak-cabal {};