diff --git a/.gitignore b/.gitignore index cc17fa8..95b7b23 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ install_manifest.txt defaults.c runner.c +result diff --git a/CMakeLists.txt b/CMakeLists.txt index b1dde4a..055af67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # preamble project( Lsyncd ) -cmake_minimum_required( VERSION 2.8 ) +cmake_minimum_required( VERSION 3.10 ) set( LSYNCD_VERSION 2.2.3 ) set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/" ) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b06a406 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1637014545, + "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1637709854, + "narHash": "sha256-y98gkOBUEiPAmwRhZPzTQ0YayZKPS2loNgA0GcNewMM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "9c43581935a23d56734bd02da0ba8e7fda21e747", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "release-21.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1dd4ad5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,52 @@ +{ + description = "Lsyncd (Live Syncing Daemon)"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs/release-21.05"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + defaultDeps = with pkgs; [ + gcc + cmake + glib + ]; + version = builtins.elemAt + (builtins.match ''.*set\(.LSYNCD_VERSION ([0-9\.]*).*'' + (builtins.substring 0 500 + (builtins.readFile ./CMakeLists.txt))) 0; + # buildTypes = { + # lua5_2 = pkgs.lua5_2; + # lua5_3 = pkgs.lua5_3; + # }; + in + let + mkLsync = luaPackage: pkgs.stdenv.mkDerivation ({ + inherit version; + name = "lsyncd"; + + src = ./.; + + # nativeBuildInputs = [ pkgs.qt5.wrapQtAppsHook ]; + buildInputs = defaultDeps ++ [luaPackage]; + }); + in + { + packages = { + lsyncd = mkLsync pkgs.lua5_3; + lsyncd_lua5_1 = mkLsync pkgs.lua5_1; + lsyncd_lua5_2 = mkLsync pkgs.lua5_2; + lsyncd_lua5_3 = mkLsync pkgs.lua5_3; + lsyncd_lua5_4 = mkLsync pkgs.lua5_4; + }; + + defaultPackage = self.packages.${system}.lsyncd; + devShell = pkgs.mkShell { + buildInputs = defaultDeps; + }; + } + ); +} \ No newline at end of file