From 2757bd090c956275bf0038a1b50e83408366d825 Mon Sep 17 00:00:00 2001 From: Mika Bomm Date: Fri, 5 Jul 2024 12:34:49 +0200 Subject: [PATCH 1/7] web: delete initial front page --- web/components.d.ts | 1 + web/src/App.vue | 4 +- web/src/components/HelloWorld.vue | 157 ------------------------------ web/src/components/StartPage.vue | 13 +++ 4 files changed, 17 insertions(+), 158 deletions(-) delete mode 100644 web/src/components/HelloWorld.vue create mode 100644 web/src/components/StartPage.vue diff --git a/web/components.d.ts b/web/components.d.ts index eb860ff..fd226cb 100644 --- a/web/components.d.ts +++ b/web/components.d.ts @@ -8,5 +8,6 @@ export {} declare module 'vue' { export interface GlobalComponents { HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] + StartPage: typeof import('./src/components/StartPage.vue')['default'] } } diff --git a/web/src/App.vue b/web/src/App.vue index 6f5c110..3521a51 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,11 +1,13 @@ diff --git a/web/src/components/HelloWorld.vue b/web/src/components/HelloWorld.vue deleted file mode 100644 index 9eb8594..0000000 --- a/web/src/components/HelloWorld.vue +++ /dev/null @@ -1,157 +0,0 @@ - - - diff --git a/web/src/components/StartPage.vue b/web/src/components/StartPage.vue new file mode 100644 index 0000000..3e1aeda --- /dev/null +++ b/web/src/components/StartPage.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file From 2d15d63dcbaa911cd6cf4b84472908419bd2780b Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 5 Jul 2024 12:33:15 +0200 Subject: [PATCH 2/7] make a simple c++ project --- .gitignore | 1 + flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 14 ++++++++++++++ meson.build | 32 ++------------------------------ native/main.cpp | 6 ++++++ native/meson.build | 5 +++++ nix/default.nix | 5 +++++ nix/native.nix | 20 ++++++++++++++++++++ 8 files changed, 80 insertions(+), 30 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 native/main.cpp create mode 100644 native/meson.build create mode 100644 nix/default.nix create mode 100644 nix/native.nix diff --git a/.gitignore b/.gitignore index 4f518cb..2e80806 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ # Added by cargo /target +/result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ed5e17d --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1720031269, + "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f694ac8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,14 @@ +{ + description = "License Managment tool"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = inputs@{ self, nixpkgs, ... }: { + packages = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: import ./nix { + inherit system inputs; + pkgs = nixpkgs.legacyPackages.${system}; + }); + }; +} diff --git a/meson.build b/meson.build index f3994b3..957fb89 100644 --- a/meson.build +++ b/meson.build @@ -1,35 +1,7 @@ project( 'lf2', - 'c', - 'cpp', - meson_version: '>=0.58.0', - default_options: [ - 'cpp_std=c++20', - 'warning_level=2', - ], + 'cpp' ) -cppc = meson.get_compiler('cpp') +subdir('native') -prefix = get_option('prefix') -data_dir = get_option('datadir') -lib_dir = get_option('libdir') - -add_project_arguments(cppc.get_supported_arguments([ - '-Wno-unused-parameter', - '-Wno-missing-field-initializers', - '-Wno-c99-designator', - '-Wno-invalid-offsetof', - '-Wno-unused-const-variable', - '-Wno-volatile', # glm warning - '-Wno-deprecated-volatile', -]), language: 'cpp') - -add_project_arguments(cppc.get_supported_arguments([ - '-ffast-math', -]), language: 'cpp') - -sqlite3_dep = dependency('sqlite3') -vulkan_dep = dependency('vulkan') - -subdir('src') diff --git a/native/main.cpp b/native/main.cpp new file mode 100644 index 0000000..7867d62 --- /dev/null +++ b/native/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::cout << "Hello World!"; + return 0; +} diff --git a/native/meson.build b/native/meson.build new file mode 100644 index 0000000..9364a6b --- /dev/null +++ b/native/meson.build @@ -0,0 +1,5 @@ +executable( + 'license-tool', + 'main.cpp', + install: true, +) diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000..b30fa70 --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,5 @@ +{ system, pkgs, inputs }: + +{ + native = pkgs.callPackage ./native.nix {}; +} diff --git a/nix/native.nix b/nix/native.nix new file mode 100644 index 0000000..cf696c7 --- /dev/null +++ b/nix/native.nix @@ -0,0 +1,20 @@ +{ + lib, + stdenv, + meson, + ninja, +}: + +stdenv.mkDerivation { + pname = "native"; + version = "0.1"; + + src = ../.; + + nativeBuildInputs = [ meson ninja ]; + + meta = { + maintainers = with lib.maintainers; [ jopejoe1 ]; + platforms = lib.platforms.all; + }; +} From 4f864750687eebc0e78f49f63f4c126b4ba4fb22 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 5 Jul 2024 13:31:02 +0200 Subject: [PATCH 3/7] nix: use legacy packages --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index f694ac8..111933a 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ }; outputs = inputs@{ self, nixpkgs, ... }: { - packages = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: import ./nix { + legacyPackages = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: import ./nix { inherit system inputs; pkgs = nixpkgs.legacyPackages.${system}; }); From e877b946538175055d24e8e2a207652866acd740 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 5 Jul 2024 13:34:26 +0200 Subject: [PATCH 4/7] nix/native: set mainProgram --- nix/native.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/native.nix b/nix/native.nix index cf696c7..76878d9 100644 --- a/nix/native.nix +++ b/nix/native.nix @@ -15,6 +15,7 @@ stdenv.mkDerivation { meta = { maintainers = with lib.maintainers; [ jopejoe1 ]; + mainProgram = "license-tool"; platforms = lib.platforms.all; }; } From a35cc60f237588c6d05dc72c5d16e93f52749d2e Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 5 Jul 2024 13:45:42 +0200 Subject: [PATCH 5/7] nix/backend: init --- nix/backend.nix | 19 +++++++++++++++++++ nix/default.nix | 1 + 2 files changed, 20 insertions(+) create mode 100644 nix/backend.nix diff --git a/nix/backend.nix b/nix/backend.nix new file mode 100644 index 0000000..b2c031e --- /dev/null +++ b/nix/backend.nix @@ -0,0 +1,19 @@ +{ + lib, + rustPlatform, + stdenv, +}: + +rustPlatform.buildRustPackage rec { + pname = "backend"; + version = "0.1"; + + src = ../.; + + cargoHash = "sha256-NRrWWD3e2zm4rVYyCPm3vQhPDRkVMauTnoENwRucXcw="; + + meta = with lib; { + platforms = lib.platforms.all; + mainProgram = "backend"; + }; +} diff --git a/nix/default.nix b/nix/default.nix index b30fa70..9f96829 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -2,4 +2,5 @@ { native = pkgs.callPackage ./native.nix {}; + backend = pkgs.callPackage ./backend.nix {}; } From 6ffdf237974f9387c50881d64c9e17fa6a827b59 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 5 Jul 2024 13:55:44 +0200 Subject: [PATCH 6/7] nix/web: init --- nix/default.nix | 1 + nix/web.nix | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 nix/web.nix diff --git a/nix/default.nix b/nix/default.nix index 9f96829..0dfc887 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -3,4 +3,5 @@ { native = pkgs.callPackage ./native.nix {}; backend = pkgs.callPackage ./backend.nix {}; + web = pkgs.callPackage ./web.nix {}; } diff --git a/nix/web.nix b/nix/web.nix new file mode 100644 index 0000000..3f976eb --- /dev/null +++ b/nix/web.nix @@ -0,0 +1,30 @@ +{ + stdenv, + lib, + pnpm, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "web"; + version = "0.1"; + + src = ../web; + + pnpmDeps = pnpm.fetchDeps { + inherit (finalAttrs) pname version src; + hash = "sha256-dTXWbUDjmlIlMZ/sIFaInTRmVdWpyzJA4oadJAzUivs="; + }; + + nativeBuildInputs = [ + pnpm.configHook + ]; + + buildInputs = [ + ]; + + dontStrip = true; + + meta = with lib; { + platforms = lib.platforms.all; + }; +}) From e6bed3dc6513046420029708ae5d8d59a392ea79 Mon Sep 17 00:00:00 2001 From: Mika Bomm Date: Fri, 5 Jul 2024 14:37:10 +0200 Subject: [PATCH 7/7] web: added seperation --- web/src/App.vue | 4 ++++ web/src/components/StartPage.vue | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/web/src/App.vue b/web/src/App.vue index 3521a51..2844785 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -11,3 +11,7 @@ import StartPage from './components/StartPage.vue'; // + + \ No newline at end of file diff --git a/web/src/components/StartPage.vue b/web/src/components/StartPage.vue index 3e1aeda..d9668d2 100644 --- a/web/src/components/StartPage.vue +++ b/web/src/components/StartPage.vue @@ -1,4 +1,15 @@