Skip to content

Commit

Permalink
Tweak version numbers and fix arbitrary instance
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Jul 27, 2024
1 parent 842754d commit 3f60edb
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 12 deletions.
10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
let
pkgs = import nixpkgs { inherit system; };

versionSuffix = 0;
majorVersion = 0;
minorVersion = 0;

# Fix a spec issue where the ContainerSummary definition is wrongly specified as an array,
# rather than an object
Expand All @@ -18,7 +19,7 @@
'';

mkApiYaml = { src, fixes ? [] }: pkgs.stdenv.mkDerivation {
name = "docker-api-1.39.${toString versionSuffix}.yaml";
name = "docker-api.yaml";
inherit src;
unpackPhase = ''
cp $src api.yaml
Expand Down Expand Up @@ -89,7 +90,7 @@
-o "${dir}"
# Fill in the package version
PACKAGE_VERSION="${builtins.replaceStrings ["_"] ["."] (builtins.substring 1 (-1) dir)}.${toString versionSuffix}"
PACKAGE_VERSION="${toString majorVersion}.${builtins.replaceStrings ["."] [""] (builtins.substring 1 (-1) dir)}.${toString minorVersion}"
${pkgs.gnused}/bin/sed -i "s/^version:\s*\(.*\)/version: $PACKAGE_VERSION/" "${dir}/docker-engine.cabal"
# Fill in license
Expand Down Expand Up @@ -117,6 +118,9 @@
# This "Map" type is emitted for the "Topology" definition. Not sure how to correct
# the spec, so let's just provide a type alias here.
echo "type Map = HM.HashMap String String" >> "${dir}/lib/DockerEngine/Model.hs"
# Similarly patch up the test instances
${pkgs.gnused}/bin/sed -i '1i{-# LANGUAGE FlexibleInstances #-}' "${dir}/tests/Instances.hs"
echo 'instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary' >> "${dir}/tests/Instances.hs"
'';

in
Expand Down
2 changes: 1 addition & 1 deletion v1.36/docker-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: docker-engine
version: 1.36.0
version: 0.136.0
synopsis: Auto-generated docker-engine API Client
description: .
Client library for calling the Docker Engine API API based on http-client.
Expand Down
2 changes: 2 additions & 0 deletions v1.36/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}

Expand Down Expand Up @@ -2417,3 +2418,4 @@ instance Arbitrary Reachability where
instance Arbitrary TaskState where
arbitrary = arbitraryBoundedEnum

instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary
2 changes: 1 addition & 1 deletion v1.37/docker-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: docker-engine
version: 1.37.0
version: 0.137.0
synopsis: Auto-generated docker-engine API Client
description: .
Client library for calling the Docker Engine API API based on http-client.
Expand Down
2 changes: 2 additions & 0 deletions v1.37/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}

Expand Down Expand Up @@ -2416,3 +2417,4 @@ instance Arbitrary Reachability where
instance Arbitrary TaskState where
arbitrary = arbitraryBoundedEnum

instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary
2 changes: 1 addition & 1 deletion v1.38/docker-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: docker-engine
version: 1.38.0
version: 0.138.0
synopsis: Auto-generated docker-engine API Client
description: .
Client library for calling the Docker Engine API API based on http-client.
Expand Down
2 changes: 2 additions & 0 deletions v1.38/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}

Expand Down Expand Up @@ -2435,3 +2436,4 @@ instance Arbitrary Reachability where
instance Arbitrary TaskState where
arbitrary = arbitraryBoundedEnum

instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary
2 changes: 1 addition & 1 deletion v1.39/docker-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: docker-engine
version: 1.39.0
version: 0.139.0
synopsis: Auto-generated docker-engine API Client
description: .
Client library for calling the Docker Engine API API based on http-client.
Expand Down
2 changes: 2 additions & 0 deletions v1.39/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}

Expand Down Expand Up @@ -2527,3 +2528,4 @@ instance Arbitrary Reachability where
instance Arbitrary TaskState where
arbitrary = arbitraryBoundedEnum

instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary
2 changes: 1 addition & 1 deletion v1.40/docker-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: docker-engine
version: 1.40.0
version: 0.140.0
synopsis: Auto-generated docker-engine API Client
description: .
Client library for calling the Docker Engine API API based on http-client.
Expand Down
2 changes: 2 additions & 0 deletions v1.40/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}

Expand Down Expand Up @@ -2557,3 +2558,4 @@ instance Arbitrary Reachability where
instance Arbitrary TaskState where
arbitrary = arbitraryBoundedEnum

instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary
2 changes: 1 addition & 1 deletion v1.41/docker-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: docker-engine
version: 1.41.0
version: 0.141.0
synopsis: Auto-generated docker-engine API Client
description: .
Client library for calling the Docker Engine API API based on http-client.
Expand Down
2 changes: 2 additions & 0 deletions v1.41/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}

Expand Down Expand Up @@ -2651,3 +2652,4 @@ instance Arbitrary Reachability where
instance Arbitrary TaskState where
arbitrary = arbitraryBoundedEnum

instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary
2 changes: 1 addition & 1 deletion v1.42/docker-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: docker-engine
version: 1.42.0
version: 0.142.0
synopsis: Auto-generated docker-engine API Client
description: .
Client library for calling the Docker Engine API API based on http-client.
Expand Down
2 changes: 2 additions & 0 deletions v1.42/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}

Expand Down Expand Up @@ -2759,3 +2760,4 @@ instance Arbitrary Reachability where
instance Arbitrary TaskState where
arbitrary = arbitraryBoundedEnum

instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary
2 changes: 1 addition & 1 deletion v1.43/docker-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: docker-engine
version: 1.43.0
version: 0.143.0
synopsis: Auto-generated docker-engine API Client
description: .
Client library for calling the Docker Engine API API based on http-client.
Expand Down
2 changes: 2 additions & 0 deletions v1.43/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}

Expand Down Expand Up @@ -2763,3 +2764,4 @@ instance Arbitrary Reachability where
instance Arbitrary TaskState where
arbitrary = arbitraryBoundedEnum

instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary
2 changes: 1 addition & 1 deletion v1.44/docker-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: docker-engine
version: 1.44.0
version: 0.144.0
synopsis: Auto-generated docker-engine API Client
description: .
Client library for calling the Docker Engine API API based on http-client.
Expand Down
2 changes: 2 additions & 0 deletions v1.44/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-matches #-}

Expand Down Expand Up @@ -2804,3 +2805,4 @@ instance Arbitrary Reachability where
instance Arbitrary TaskState where
arbitrary = arbitraryBoundedEnum

instance Arbitrary (HM.HashMap String String) where arbitrary = HM.fromList <$> arbitrary

0 comments on commit 3f60edb

Please sign in to comment.