Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/cabal2nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d1d82087bedb
Choose a base ref
...
head repository: NixOS/cabal2nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 50125218b2a2
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Mar 5, 2019

  1. Copy the full SHA
    d6bac1c View commit details
  2. hackage2nix: disable aliases before discovering known Nixpkgs attributes

    Closing #411.
    
    Suggested-by: Jan Tojnar <jtojnar@gmail.com>
    peti committed Mar 5, 2019
    Copy the full SHA
    87c9b8d View commit details
  3. Update name mapping and resolver lists to cope with disappeared aliases.

    See #411 (comment) and
    following comments for details.
    peti committed Mar 5, 2019
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5012521 View commit details
Showing with 15 additions and 17 deletions.
  1. +6 −6 cabal2nix.cabal
  2. +2 −6 hackage2nix/Main.hs
  3. +1 −1 src/Distribution/Nixpkgs/Haskell/FromCabal.hs
  4. +6 −4 src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs
12 changes: 6 additions & 6 deletions cabal2nix.cabal
Original file line number Diff line number Diff line change
@@ -107,15 +107,15 @@ library
Distribution.Nixpkgs.Haskell.PackageSourceSpec
other-modules: Paths_cabal2nix
hs-source-dirs: src
build-depends: base < 5
, Cabal > 2.2
build-depends: base > 4.11
, Cabal > 2.4
, aeson
, ansi-wl-pprint
, bytestring
, containers
, deepseq >= 1.4
, directory
, distribution-nixpkgs >= 1.1.1
, distribution-nixpkgs >= 1.2
, filepath
, hackage-db >= 2.0.1
, hopenssl >= 2
@@ -159,13 +159,13 @@ executable hackage2nix
Paths_cabal2nix
hs-source-dirs: hackage2nix
build-depends: base < 5
, Cabal > 2.2
, Cabal > 2.4
, aeson
, bytestring
, cabal2nix
, containers
, directory
, distribution-nixpkgs >= 1.1.1
, distribution-nixpkgs >= 1.2
, filepath
, hopenssl >= 2
, language-nix
@@ -185,7 +185,7 @@ test-suite regression-test
main-is: Main.hs
hs-source-dirs: test
build-depends: base
, Cabal > 2.2
, Cabal > 2.4
, cabal2nix
, containers
, directory
8 changes: 2 additions & 6 deletions hackage2nix/Main.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE CPP #-}

module Main ( main ) where

@@ -15,9 +14,6 @@ import Data.List
import Data.Map.Strict ( Map )
import qualified Data.Map.Strict as Map
import Data.Maybe
#if !MIN_VERSION_base(4,11,0)
import Data.Monoid
#endif
import Data.Set ( Set )
import qualified Data.Set as Set
import Data.String
@@ -30,7 +26,7 @@ import Distribution.Nixpkgs.Haskell.FromCabal.Flags
import Distribution.Nixpkgs.Meta
import Distribution.Nixpkgs.PackageMap
import Distribution.Package
import Distribution.PackageDescription hiding ( options, buildDepends, extraLibs, buildTools, homepage )
import Distribution.PackageDescription hiding ( options, extraLibs, buildTools, homepage )
import Distribution.System
import Distribution.Text
import Distribution.Version
@@ -75,7 +71,7 @@ main = do
CLI {..} <- execParser pinfo

config <- readConfiguration (nixpkgsRepository </> configFile)
nixpkgs <- readNixpkgPackageMap nixpkgsRepository Nothing
nixpkgs <- readNixpkgPackageMap ["-f", nixpkgsRepository, "--arg", "config", "{ allowAliases = false; }"]
preferredVersions <- readPreferredVersions (fromMaybe (hackageRepository </> "preferred-versions") preferredVersionsFile)
let fixup = Map.delete "acme-everything" -- TODO: https://github.com/NixOS/cabal2nix/issues/164
. Map.delete "som" -- TODO: https://github.com/NixOS/cabal2nix/issues/164
2 changes: 1 addition & 1 deletion src/Distribution/Nixpkgs/Haskell/FromCabal.hs
Original file line number Diff line number Diff line change
@@ -139,7 +139,7 @@ fromPackageDescription haskellResolver nixpkgsResolver missingDeps flags Package
| i == "gtk2" = binding # (i, path # ["pkgs","gtk2"]) -- TODO: these cases should not be necessary
| i == "gtk3" = binding # (i, path # ["pkgs","gtk3"])
| i == "gtksourceview3" = binding # (i, path # ["pkgs","gtksourceview3"])
| i == "vte_291" = binding # (i, path # ["pkgs","vte"])
| i == "vte_291" = binding # (i, path # ["pkgs","vte"])
| Just p <- nixpkgsResolver i, init (view (reference . path) p) `Set.member` goodScopes = p
| otherwise = bindNull i

10 changes: 6 additions & 4 deletions src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ libNixName "GL" = return "libGL"
libNixName "GLU" = ["libGLU","libGL"]
libNixName "glut" = ["freeglut","libGLU","libGL"]
libNixName "gnome-keyring" = return "gnome-keyring"
libNixName "gnome-keyring-1" = return "libgnome_keyring"
libNixName "gnome-keyring-1" = return "libgnome-keyring"
libNixName "gnome-vfs-2.0" = return "gnome-vfs"
libNixName "gnome-vfs-module-2.0" = return "gnome-vfs_module"
libNixName "gobject-2.0" = return "glib"
@@ -84,8 +84,8 @@ libNixName "ImageMagick" = return "imagemagick"
libNixName "Imlib2" = return "imlib2"
libNixName "iw" = return "wirelesstools"
libNixName "jack" = return "libjack2"
libNixName "javascriptcoregtk-3.0" = return "webkitgtk24x-gtk3" -- These are the old APIs, of which 2.4 is the last provider, so map directly to that.
libNixName "javascriptcoregtk-4.0" = return "webkitgtk" -- This is the current API, so let it reference an alias for the latest version.
libNixName "javascriptcoregtk-3.0" = return "webkitgtk24x-gtk3" -- These are the old APIs, of which 2.4 is the last provider, so map directly to that.
libNixName "javascriptcoregtk-4.0" = return "webkit" -- I have no clue whether this is correct or not.
libNixName "jpeg" = return "libjpeg"
libNixName "jvm" = return "jdk"
libNixName "lapack" = return "liblapack"
@@ -94,6 +94,7 @@ libNixName "ldap" = return "openldap"
libNixName "libavutil" = return "ffmpeg"
libNixName "libgsasl" = return "gsasl"
libNixName "libpcre" = return "pcre"
libNixName "libqrencode" = return "qrencode"
libNixName "libR" = return "R"
libNixName "libsoup-gnome-2.4" = return "libsoup"
libNixName "libsystemd" = return "systemd"
@@ -153,7 +154,8 @@ libNixName "wayland-client" = return "wayland"
libNixName "wayland-cursor" = return "wayland"
libNixName "wayland-egl" = return "libGL"
libNixName "wayland-server" = return "wayland"
libNixName "webkit2gtk-4.0" = return "webkitgtk" -- This is the current API, so let it reference an alias for the latest version.
libNixName "webkit2gtk" = return "webkit"
libNixName "webkit2gtk-4.0" = return "webkit"
libNixName "webkit2gtk-web-extension-4.0" = return "webkitgtk-web-extension" -- This package doesn't actually exist in nixpkgs at present.
libNixName "webkitgtk-3.0" = return "webkitgtk24x-gtk3" -- These are the old APIs, of which 2.4 is the last provider, so map directly to that
libNixName "X11" = return "libX11"