diff --git a/channel.tar.bz2 b/channel.tar.bz2 new file mode 100644 index 0000000..81b16ac Binary files /dev/null and b/channel.tar.bz2 differ diff --git a/composer.json b/composer.json deleted file mode 100644 index 090fde5..0000000 --- a/composer.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "laravel/laravel", - "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], - "license": "MIT", - "type": "project", - "require": { - "php": ">=7.1.3", - "doctrine/dbal": "^2.9", - "enqueue/amqp-bunny": "^0.10.0", - "enqueue/simple-client": "^0.10.0", - "fideloper/proxy": "~4.0", - "intervention/image": "^2.5", - "jasig/phpcas": "1.3.4", - "laravel/framework": "^5.7.7", - "laravel/tinker": "~1.0", - "maatwebsite/excel": "^3.1", - "subfission/cas": "2.0.9", - "symfony/process": "^4.4.1" - }, - "require-dev": { - "beyondcode/laravel-er-diagram-generator": "^1.4", - "filp/whoops": "~2.0", - "fzaninotto/faker": "~1.4", - "mockery/mockery": "~1.0", - "phpunit/phpunit": "~7.0" - }, - "autoload": { - "classmap": [ - "database/seeds", - "database/factories" - ], - "psr-4": { - "App\\": "app/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests/" - } - }, - "extra": { - "laravel": { - "dont-discover": [ - "TelescopeServiceProvider" - ] - } - }, - "scripts": { - "post-root-package-install": [ - "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" - ], - "post-create-project-cmd": [ - "@php artisan key:generate" - ], - "post-autoload-dump": [ - "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", - "@php artisan package:discover" - ] - }, - "config": { - "preferred-install": "dist", - "sort-packages": true, - "optimize-autoloader": true - } -} diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..473f38c --- /dev/null +++ b/default.nix @@ -0,0 +1,9 @@ +{ system ? builtins.currentSystem }: +let + pkgs = import { inherit system; }; + #self = in self +in rec { + search-and-displace = pkgs.callPackage ./pkgs/sandd.nix { + inherit pkgs; + }; +} diff --git a/composer-env.nix b/pkgs/composer-env.nix similarity index 100% rename from composer-env.nix rename to pkgs/composer-env.nix diff --git a/sandd.nix b/pkgs/earlier.nix similarity index 58% rename from sandd.nix rename to pkgs/earlier.nix index 5119047..177844d 100644 --- a/sandd.nix +++ b/pkgs/earlier.nix @@ -3,7 +3,19 @@ }, system ? builtins.currentSystem }: let - name = "search-and-diplace"; + name = "search-and-displace"; + # gitStore = builtins.fetchGit { + # url = "https://github.com/searchanddisplace/searchanddisplace.git"; + # ref = "master"; + # }; + # builtins.filterSource + # (path: type: baseNameOf path != "sandd-php-packages.nix" || baseNameOf path != "earlier.nix" || baseNameOf path != "composer-env.nix") + # (builtins.fetchGit { + # url = "https://github.com/searchanddisplace/searchanddisplace.git"; + # ref = "master"; + # }); + + inherit (pkgs) stdenv; composerEnv = import ./composer-env.nix { inherit (pkgs) stdenv writeTextFile fetchurl php unzip phpPackages; @@ -11,19 +23,16 @@ let phpPackage = import ./sandd-php-packages.nix { inherit composerEnv; inherit (pkgs) fetchurl fetchgit fetchhg fetchsvn; + #src = gitStore; noDev = true; # Disable development dependencies inherit name; }; in -with import (builtins.fetchurl https://github.com/searchanddisplace/searchanddisplace/raw/master/composer.json) {}; phpPackage.override { - #buildCommand = '' - # curl -o composer.json https://github.com/searchanddisplace/searchanddisplace/raw/master/composer.json - #''; removeComposerArtifacts = true; # Remove composer configuration files buildInputs = [ pkgs.git ]; # Add here any environment dependency # Add below all lines of post installation instructions e.g ''npm install'' ? postInstall = '' - + ll ./ ''; } \ No newline at end of file diff --git a/sandd-php-packages.nix b/pkgs/sandd-php-packages.nix similarity index 83% rename from sandd-php-packages.nix rename to pkgs/sandd-php-packages.nix index 710e852..18a741e 100644 --- a/sandd-php-packages.nix +++ b/pkgs/sandd-php-packages.nix @@ -1,4 +1,4 @@ -{composerEnv, fetchurl, fetchgit ? null, fetchhg ? null, fetchsvn ? null, noDev ? false, name ? "default"}: +{composerEnv, fetchurl, fetchgit ? null, fetchhg ? null, fetchsvn ? null, src ? ./., noDev ? false, name ? "default"}: let packages = { @@ -10,7 +10,7 @@ in composerEnv.buildPackage { inherit packages devPackages noDev; inherit name; - src = ./.; + inherit src; executable = false; symlinkDependencies = false; meta = {}; diff --git a/pkgs/sandd.nix b/pkgs/sandd.nix new file mode 100644 index 0000000..b774970 --- /dev/null +++ b/pkgs/sandd.nix @@ -0,0 +1,28 @@ +{ pkgs ? import { + inherit system; + }, system ? builtins.currentSystem +}: +let + name = "search-and-displace"; + inherit (pkgs) stdenv git curl php phpPackages; + inherit (phpPackages) composer; + gitStore = builtins.fetchGit { + url = "https://github.com/searchanddisplace/searchanddisplace.git"; + ref = "master"; + }; + buildPackage = { name, src }: + stdenv.mkDerivation { + inherit name src; + buildInputs = [ ]; + buildCommand = '' + composer install + npm install + cp .env.example .env + # Remove stuff not needed on production - composer.loc, .json, etc, etc + ''; + }; +in +buildPackage { + inherit name; + src = gitStore; +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..ae2a865 --- /dev/null +++ b/readme.md @@ -0,0 +1,26 @@ +## Search & Displace + +## :information_source: About + +Search and Displace is developing a workflow and toolchain which intends to address +the problem of mass search and displacement for document content where the original +documents are in a range of forms, including a wide variety of digital document formats, +both binary and more modern compressed XML forms, but also encompassing older documents +where the only surviving form is printed or even handwritten. + +## :rocket: Installation + +First install nix following the instructions on their website at https://nixos.org/nix/manual/#chap-installation + +The add searchanddiplace channel to your nix environment and update it: +```bash +nix-channel --add https://github.com/searchanddisplace/searchanddisplace/channel.tar.bz2 +nix-channel --update +``` + +You can now install search-and-displace: + +nix-env -iA searchanddisplace.default + +## :roller_coaster: Usage +