Skip to content

Commit

Permalink
Test adding libsodium for crypto stuff
Browse files Browse the repository at this point in the history
MESON LSP IS THE WORST THING IN THE UNIVERSE AFTER TOMATO JAM.
I tried to nuke this thing already, and it is always back with its bugs where files are not saved, lines are trimmed and it makes reproducing errors a joke.
  • Loading branch information
KaruroChori committed Jan 23, 2025
1 parent 03473c5 commit ad74fb3
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ jobs:
meson \
ninja \
fltk \
lua
lua \
libsodium
brew install --cask xquartz
cd /opt/homebrew/opt/llvm/bin
#ln -s clang++ clang++-19
Expand Down
49 changes: 49 additions & 0 deletions docs/developers/ideas/app-packaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
At the moment the way `app` is designed is not really great in my opinion.
It lacks the ability to properly describe information about it and its distribution.
Also, it forces the distribution of an application in multiple files, which might not always be desirable.
Even less so if the plan is to distribute them as single executables at some point.
So...

```xml
<package circuit="vs.fltk" name="..." type="app" version=""> <!-- types can be app/lib/patch/data for now -->
<i18n src="..." default="en-uk">
<!--This part is very limited and only related to the file itself. It is not i18n for the underlying app-->
<entry tag="..." desc="...">
<locale lang="en" country="uk">...</locale>
</entry>
</i18n>

<metadata>
<authors>
<entry src="..." covers="" excludes=""/>
</authors>
<licences>
<entry src="..." covers="" excludes=""/>
</licences>
<changelog>
<entry src="..." version=""/>
</changelog>
<links>
<entry ref="..." label="...">
</links>
<signature authority="..." value="..."/>
<package-id>...</package-id>
</metadata>

<link-with>
<entry src.object="" src.header=""/>
</link-with>

<policies>
</policies>

<deps>
<dep name="" src="" version="" excludes="" signature=""/> <!--body is foldback-->
<patch for="" src="" signature=""/> <!--body is foldback-->
</deps>

<entry src="...">
<!--Alternative if `src` fails or is not specified -->
</entry>
</package>
```
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ json_dep = json_proj.get_variable('nlohmann_json_dep')
#VS.TEMPL
vs_templ_dep = dependency('vs-templ', version: '>=0.3.15', fallback: ['vs-templ', 'vs_templ_dep'])

#LIBSODIUM
libsodium_dep = dependency('libsodium', version: '>=1.0.20')

#TREESITTER
treesitter_proj = subproject('tree-sitter')
treesitter_dep = treesitter_proj.get_variable('tree_sitter_dep')
Expand Down
21 changes: 21 additions & 0 deletions subprojects/libsodium.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[wrap-git]
url = https://github.com/jedisct1/libsodium
revision = 1.0.20-RELEASE
depth = 1
patch_directory = libsodium
method = meson

[provide]
libsodium = libsodium_dep


#[wrap-file]
#source_url = https://download.libsodium.org/libsodium/releases/libsodium-1.0.20.tar.gz
#source_filename = libsodium-1.0.20.tar.gz
#source_hash = ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19
#patch_directory = libsodium
#method = meson
#lead_directory_missing = false#
#
#[provide]
#libsodium = libsodium_dep
21 changes: 21 additions & 0 deletions subprojects/packagefiles/libsodium/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
project(
'libsodium',
'c',
meson_version: '>=0.56.0',
version: '1.0.20'
)

mod = import('unstable-external_project')

p = mod.add_project(
'configure',
configure_options: [
'--prefix=@PREFIX@',
'--libdir=@PREFIX@/@LIBDIR@',
'--includedir=@PREFIX@/@INCLUDEDIR@',
#'--enable-foo',
],
)

libsodium_dep = p.dependency('libsodium')
meson.override_dependency('libsodium', libsodium_dep)

0 comments on commit ad74fb3

Please sign in to comment.