Skip to content

Commit

Permalink
ref: remove dire executable
Browse files Browse the repository at this point in the history
  • Loading branch information
Dich0tomy committed Mar 9, 2024
1 parent d9a2683 commit c491cc7
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 47 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ TODO:
- [x] Merge PR and go public
- [x] Change codeowners
- [x] Documentation generation
- [ ] Add conan and vcpkg packaging methods
- [ ] Add dire executable
- [ ] Write docs with diataxis fr
- [ ] Releases on GitHub
- [ ] Refactor so far #3
- [ ] Better readme (diataxis docs)
- [ ] Refactor so far #4

Plans:
- [ ] Add conan and vcpkg packaging methods **\***

- [ ] Package returned dirs in special objects with the following methods **\***:
- [ ] `writable() -> bool` - cross platform checking if the dir is writable into (we mean every notion of writable - delete, update, create new file, etc.)
- [ ] `readable() -> bool` - cross platform checking if the dir is readble (same here)
Expand Down
4 changes: 3 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@

rootDir = ./.;

package = import ./nix/package/package.nix {inherit pkgs buildDeps nativeDeps rootDir lib;};
version = (builtins.readFile ./VERSION);

package = import ./nix/package/package.nix {inherit pkgs buildDeps nativeDeps rootDir lib version;};
in {
formatter = pkgs.alejandra;

Expand Down
2 changes: 1 addition & 1 deletion nix/package/dire-dev.pc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ libdir=${prefix}/lib

Name: libdire
Description: Complete cross-platform data and user dirs discovery.
Version: 0.1.0
Version: @version@
Libs: -L${libdir}/ -ldire
Cflags: -I${includedir}/
2 changes: 1 addition & 1 deletion nix/package/dire-lib.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ libdir=${prefix}/lib

Name: libdire
Description: Complete cross-platform data and user dirs discovery.
Version: 0.1.0
Version: @version@
Libs: -L${libdir}/ -ldire
21 changes: 10 additions & 11 deletions nix/package/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
nativeDeps,
buildDeps,
rootDir,
version
}: let
dire-pkgconfig-dev = pkgs.substituteAll { src = ./dire-dev.pc; inherit version; };
dire-pkgconfig-lib = pkgs.substituteAll { src = ./dire-dev.pc; inherit version; };

direBase = pkgs.stdenv.mkDerivation {
pname = "dire";
version = "0.1.0";
Expand All @@ -16,32 +20,27 @@

dontUseCmakeConfigure = true;

# out - dire app
# out - dire lib without headers
# dev - dire lib with headers
# lib - dire lib without headers
outputs = ["out" "lib" "dev"];
outputs = ["out" "dev"];

nativeBuildInputs = nativeDeps;
buildInputs = buildDeps;
preBuild = ''
mkdir -p $dev/include
cp -r $src/include/* $dev/include
cp -r $src/lib/include/* $dev/include
'';

buildPhase = "meson compile dire:static_library dire:executable";

installPhase = ''
mkdir -p {$lib,$dev,$out}/lib/pkgconfig $out/bin
mkdir -p {$dev,$out}/lib/pkgconfig
cp src/lib/libdire.a $lib/lib
cp src/lib/libdire.a $dev/lib
cp src/lib/libdire.a $out/lib
substituteAll ${./dire-dev.pc} $dev/lib/pkgconfig/dire.pc
substituteAll ${./dire-dev.pc} $out/lib/pkgconfig/dire.pc
substituteAll ${./dire-lib.pc} $lib/lib/pkgconfig/dire.pc
cp src/app/dire $out/bin
substituteAll ${dire-pkgconfig-dev} $dev/lib/pkgconfig/dire.pc
substituteAll ${dire-pkgconfig-lib} $out/lib/pkgconfig/dire.pc
'';
};

Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
add_subdirectory("lib")
add_subdirectory("app")

if(DIRE_BUILD_TESTS)
add_subdirectory("test")
Expand Down
7 changes: 0 additions & 7 deletions src/app/CMakeLists.txt

This file was deleted.

6 changes: 0 additions & 6 deletions src/app/main.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions src/app/meson.build

This file was deleted.

1 change: 0 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
subdir('lib')
subdir('app')

if(get_option('build_tests'))
subdir('test')
Expand Down

0 comments on commit c491cc7

Please sign in to comment.