packages feed

llvm-pkg-config 0.0.2 → 0.0.3

raw patch · 3 files changed

+33/−9 lines, 3 files

Files

+ llvm-pc.nix view
@@ -0,0 +1,15 @@+{ stdenv, llvmPackages, haskellPackages }:+stdenv.mkDerivation rec {+  pname = "llvm-pc";+  version = llvmPackages.llvm.version;++  buildInputs = [ haskellPackages.llvm-pkg-config ];+  propagatedBuildInputs = [ llvmPackages.libllvm ];++  phases = [ "installPhase" ];++  installPhase = ''+    mkdir -p $out/lib/pkgconfig+    llvm-pkg-config >$out/lib/pkgconfig/llvm-${llvmPackages.llvm.shortVersion}.pc+  '';+}
llvm-pkg-config.cabal view
@@ -1,6 +1,6 @@ Cabal-Version:       2.2 Name:                llvm-pkg-config-Version:             0.0.2+Version:             0.0.3 Synopsis:            Generate Pkg-Config configuration file for LLVM Description:   Building the @llvm-base@ package is fragile due to its configuration process.@@ -39,6 +39,12 @@   .   The package also includes the bash script @make-pkg-config.sh@   that should also generate the @llvm.pc@ file.+  .+  For Nix we ship a file named @llvm-pc.nix@.+  It creates the @llvm.pc@ file and exposes it to importing Nix packages.+  You can include it in your Nix expression like so:+  .+  > callPackage ./llvm-pc.nix {llvmPackages=pkgs.llvmPackages_21;} License:             BSD-3-Clause License-file:        LICENSE Author:              Henning Thielemann@@ -49,9 +55,10 @@ Build-type:          Simple Data-Files:   make-pkg-config.sh+  llvm-pc.nix  Source-Repository this-  Tag:         0.0.2+  Tag:         0.0.3   Type:        darcs   Location:    https://hub.darcs.net/thielema/llvm-pkg-config/ @@ -68,10 +75,11 @@   Hs-Source-Dirs: src   GHC-Options: -Wall -threaded   Build-depends:+    -- ToDo: Make the dependency on Cabal optional?     Cabal >=1.14 && <4,     shell-utility >=0.0 && <0.2,     process >=1.0 && <1.7,-    explicit-exception >=0.1.7 && <0.2,+    explicit-exception >=0.1.7 && <0.3,     transformers >=0.2.2 && <0.7,     utility-ht >=0.0.14 && <0.1,     base >=4.2 && <5
src/Main.hs view
@@ -23,7 +23,8 @@ createPkgConfig flags = do    fullVersion <- callLLVMConfig flags "--version"    let version = takeWhile (\c -> Char.isDigit c || c=='.') fullVersion-   libdir <- callLLVMConfig flags "--libdir"+   libs <- callLLVMConfig flags "--libs"+   ldflags <- callLLVMConfig flags "--ldflags"    includedir <- callLLVMConfig flags "--includedir"    return $ unlines $       "Name: LLVM" :@@ -32,7 +33,7 @@       "URL: http://www.llvm.org/" :       "Requires:" :       "Conflicts:" :-      printf "Libs: -L%s -lLLVM-%s" libdir version :+      printf "Libs: %s %s" ldflags libs :       printf "Cflags: -I%s" includedir :       [] @@ -40,10 +41,10 @@ run flags = do    content <- createPkgConfig flags    if Options.install flags-     then-        let path = Options.installPath flags-        in  writeFile path content >> setFileOrdinary path-     else putStr content+      then+         let path = Options.installPath flags+         in  writeFile path content >> setFileOrdinary path+      else putStr content  main :: IO () main =