Skip to content

Commit

Permalink
Merge pull request #46 from alexfmpe/deprecated
Browse files Browse the repository at this point in the history
Fix deprecation warning
  • Loading branch information
ali-abrar authored May 28, 2024
2 parents cc736d7 + acd7e6b commit 32f0147
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 64 deletions.
38 changes: 15 additions & 23 deletions .ci/default.nix
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
{ }:
let
nixpkgsSets = import ./nixpkgs.nix;
inherit (nixpkgsSets) nixos1809 nixos2003 unstable;
inherit (unstable) lib;
inherit (nixos2003.haskell.lib) doJailbreak dontCheck markUnbroken overrideCabal;
ghcs = rec {
ghc865 = nixos2003;
ghc884 = nixos2003;
ghc8107 = unstable;
ghc902 = unstable;
nixos2311 = import ./nixpkgs/23.11 {};
pkgs = nixos2311;
inherit (pkgs) lib;
inherit (pkgs.haskell.lib) doJailbreak dontCheck markUnbroken overrideCabal;
ghcs = {

"ghc8107" = pkgs;
"ghc902" = pkgs;
"ghc928" = pkgs;
"ghc948" = pkgs;
"ghc963" = pkgs;
"ghc981" = import ./nixpkgs/unstable {};
};
build =
{ nixpkgs ? import ./dep/nixpkgs {}
build =
{ nixpkgs
, ghc ? null
}:
let
baseHaskellPackages = if ghc != null then nixpkgs.haskell.packages.${ghc} else nixpkgs.haskellPackages;
haskellPackages = baseHaskellPackages.override {
overrides = self: super: import ../. { haskellPackages = self; } // {
which = self.callHackageDirect {
pkg = "which";
ver = "0.2.0.1";
sha256 = "0kfbzaz1wgzmyqvw4m57yj43x4ihalk5a7y703fa0pjv0cvvx0ss";
} {};
shelly = self.callHackageDirect {
pkg = "shelly";
ver = "1.9.0";
sha256 = "1x9d86pswkncyhnzpbx4a1kmn847kjqs0ivishn84h0w6lpf12pc";
} {};
};
overrides = self: super: import ../. { haskellPackages = self; };
};
in {
inherit (haskellPackages)
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions .ci/nixpkgs/23.11/github.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"owner": "nixos",
"repo": "nixpkgs",
"branch": "nixos-23.11",
"private": false,
"rev": "9d29cd266cebf80234c98dd0b87256b6be0af44e",
"sha256": "0bkrjx4x6sy4g9kmcddhlwrl4cpm4yvj7cljd7b8crf7kxpvaaf6"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import <nixpkgs> {}).fetchFromGitHub {
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
Expand Down
8 changes: 0 additions & 8 deletions .ci/nixpkgs/nixos1809/github.json

This file was deleted.

9 changes: 0 additions & 9 deletions .ci/nixpkgs/nixos1809/thunk.nix

This file was deleted.

2 changes: 0 additions & 2 deletions .ci/nixpkgs/nixos2003/default.nix

This file was deleted.

8 changes: 0 additions & 8 deletions .ci/nixpkgs/nixos2003/github.json

This file was deleted.

4 changes: 2 additions & 2 deletions .ci/nixpkgs/unstable/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"repo": "nixpkgs",
"branch": "nixpkgs-unstable",
"private": false,
"rev": "e0a42267f73ea52adc061a64650fddc59906fc99",
"sha256": "0r1dsj51x2rm016xwvdnkm94v517jb1rpn4rk63k6krc4d0n3kh9"
"rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f",
"sha256": "19zbxf7rb787jvyrfhl4z9sn3aisd6xvx6ikybbi75ym9sy39jds"
}
5 changes: 4 additions & 1 deletion .ci/nixpkgs/unstable/thunk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import <nixpkgs> {}).fetchFromGitHub {
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
Expand Down
4 changes: 4 additions & 0 deletions gargoyle-postgresql-connect/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for gargoyle-postgresql-connect

## 0.1.0.2

* Require resource-pool 0.4.*

## 0.1.0.1

* Add support for ghc 9.0.2
Expand Down
6 changes: 3 additions & 3 deletions gargoyle-postgresql-connect/gargoyle-postgresql-connect.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: gargoyle-postgresql-connect
version: 0.1.0.1
version: 0.1.0.2
author: Obsidian Systems LLC
maintainer: [email protected]
copyright: Copyright (C) 2019 Obsidian Systems LLC
Expand All @@ -19,13 +19,13 @@ library
ghc-prof-options: -fprof-auto-exported
build-depends:
base >=4.12 && <4.20
, bytestring >=0.10 && <0.12
, bytestring >=0.10 && <0.13
, directory >=1.3 && <1.4
, gargoyle >=0.1.1.0 && < 0.2
, gargoyle-postgresql >=0.2.0.1 && < 0.3
, gargoyle-postgresql-nix >=0.3.0.0 && < 0.4
, postgresql-simple >=0.5 && <0.8
, resource-pool >=0.2.3
, resource-pool >=0.4 && <0.5

hs-source-dirs: src
default-language: Haskell2010
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{-# LANGUAGE TypeApplications #-}
module Gargoyle.PostgreSQL.Connect (withDb, withDb', openDb) where

import Control.Monad ((>=>))
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as C8
import Data.Pool (Pool, createPool)
import Data.Pool (Pool, defaultPoolConfig, newPool, setNumStripes)
import Database.PostgreSQL.Simple (Connection, close, connectPostgreSQL)
import Gargoyle (withGargoyle)
import Gargoyle.PostgreSQL.Nix (postgresNix)
Expand All @@ -17,7 +18,7 @@ withDb dbPath f = either error pure =<< withDb' dbPath (openDb >=> f)

-- | Convert a connection string into a connection 'Pool'.
openDb :: ByteString -> IO (Pool Connection)
openDb dbUri = createPool (connectPostgreSQL dbUri) close 1 5 20
openDb dbUri = newPool $ setNumStripes (Just 1) $ defaultPoolConfig (connectPostgreSQL dbUri) close (realToFrac @Int 5) 20

-- | Connects to a database using information at the given filepath.
-- The given filepath can be either a folder (for a local db)
Expand Down
2 changes: 1 addition & 1 deletion gargoyle-postgresql-nix/gargoyle-postgresql-nix.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ library
ghc-prof-options: -fprof-auto-exported
build-depends:
base >=4.12 && <4.20
, bytestring >=0.10 && <0.12
, bytestring >=0.10 && <0.13
, gargoyle >=0.1 && <0.2
, gargoyle-postgresql >=0.2 && <0.3
, which >=0.2 && <0.3
Expand Down
6 changes: 3 additions & 3 deletions gargoyle-postgresql/gargoyle-postgresql.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ library
ghc-prof-options: -fprof-auto-exported
build-depends:
base >=4.12 && <4.20
, bytestring >=0.10 && <0.12
, bytestring >=0.10 && <0.13
, directory >=1.3 && <1.4
, gargoyle >=0.1.1.0 && < 0.2
, posix-escape >=0.1 && <0.2
, process >=1.5 && <1.7
, stringsearch >=0.3 && <0.4
, text >=1.2 && <1.3
, unix >=2.7.2 && <2.8
, text >=1.2 && <2.2
, unix >=2.7.2 && <2.9

hs-source-dirs: src
default-language: Haskell2010
Expand Down
2 changes: 1 addition & 1 deletion gargoyle/gargoyle.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ library
, filepath >=1.4.2 && <1.5
, network >=2.6.0 && <3.2
, process >=1.5.0 && <1.7
, unix >=2.7.2 && <2.8
, unix >=2.7.2 && <2.9

hs-source-dirs: src
default-language: Haskell2010

0 comments on commit 32f0147

Please sign in to comment.