mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 02:25:18 +03:00
+glib+meson+flex (#76)
This commit is contained in:
parent
0e4d60b919
commit
255f93071b
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
|||
- ubuntu-latest
|
||||
include:
|
||||
- os: macos-11
|
||||
container: "~"
|
||||
container: ~
|
||||
- os: ubuntu-latest
|
||||
container: ghcr.io/teaxyz/infuser:main
|
||||
container: ${{ matrix.container }}
|
||||
|
|
26
projects/github.com/westes/flex/package.yml
Normal file
26
projects/github.com/westes/flex/package.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
distributable:
|
||||
url: https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz
|
||||
strip-components: 1
|
||||
|
||||
versions:
|
||||
github: westes/flex
|
||||
strip: /^flex /
|
||||
|
||||
build:
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
tea.xyz/gx/make: '*'
|
||||
gnu.org/m4: 1
|
||||
script: |
|
||||
./configure --prefix={{ prefix }}
|
||||
make --jobs {{ hw.concurrency }} install
|
||||
|
||||
test:
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
script: |
|
||||
flex {{ pkg.pantry-prefix }}/test.flex
|
||||
cc lex.yy.c -lfl
|
||||
OUT=$(echo "Hello World" | ./a.out)
|
||||
test "$OUT" = "Hello
|
||||
World"
|
10
projects/github.com/westes/flex/test.flex
Normal file
10
projects/github.com/westes/flex/test.flex
Normal file
|
@ -0,0 +1,10 @@
|
|||
CHAR [a-z][A-Z]
|
||||
%%
|
||||
{CHAR}+ printf("%s", yytext);
|
||||
[ \t\n]+ printf("\n");
|
||||
%%
|
||||
int main()
|
||||
{
|
||||
yyin = stdin;
|
||||
yylex();
|
||||
}
|
2
projects/mesonbuild.com/meson.build
Normal file
2
projects/mesonbuild.com/meson.build
Normal file
|
@ -0,0 +1,2 @@
|
|||
project('hello', 'c')
|
||||
executable('hello', 'test.c')
|
33
projects/mesonbuild.com/package.yml
Normal file
33
projects/mesonbuild.com/package.yml
Normal file
|
@ -0,0 +1,33 @@
|
|||
distributable:
|
||||
url: https://github.com/mesonbuild/meson/releases/download/{{ version }}/meson-{{ version }}.tar.gz
|
||||
strip-components: 1
|
||||
|
||||
versions:
|
||||
github: mesonbuild/meson/tags
|
||||
|
||||
#FIXME
|
||||
# we need to fix the virtual-env of this thing
|
||||
|
||||
dependencies:
|
||||
python.org: 3
|
||||
|
||||
build:
|
||||
script: |
|
||||
python3 -m venv {{prefix}}/libexec
|
||||
{{prefix}}/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed meson
|
||||
mkdir {{prefix}}/bin
|
||||
ln -s {{prefix}}/libexec/bin/meson {{prefix}}/bin/meson
|
||||
|
||||
# tidy up
|
||||
find \
|
||||
{{prefix}}/libexec/bin \
|
||||
-name pip\* -o -name easy_install\* -o -name activate\* -o -name Activate.ps1 \
|
||||
| xargs rm
|
||||
|
||||
test:
|
||||
dependencies:
|
||||
ninja-build.org: 1
|
||||
tea.xyz/gx/cc: c99
|
||||
script: |
|
||||
meson {{ pkg.pantry-prefix }}
|
||||
test -f build.ninja
|
4
projects/mesonbuild.com/test.c
Normal file
4
projects/mesonbuild.com/test.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
main() {
|
||||
puts("hi");
|
||||
return 0;
|
||||
}
|
|
@ -62,6 +62,15 @@ build:
|
|||
# put data that doesn’t vary between pythons in a consistent place
|
||||
- --datarootdir="$SHARE"
|
||||
- --datadir="$SHARE"
|
||||
|
||||
#FIXME get rid of these v*
|
||||
OPENSSL_INCLUDES: /opt/openssl.org/v*/include
|
||||
OPENSSL_LDFLAGS: -L/opt/openssl.org/v*/lib'
|
||||
|
||||
#FIXME we should get the include path from the ncurses `.pc` files
|
||||
CPATH: /opt/invisible-island.net/ncurses/v*/include/ncursesw:$CPATH
|
||||
|
||||
# required for `setup.py` which is used to detect the libs for python’s modules
|
||||
diff: |
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 85a2b26..4f2f742 100644
|
||||
|
|
18
scripts/_lib.ts
Normal file
18
scripts/_lib.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import usePantry from "hooks/usePantry.ts"
|
||||
import { PackageRequirement } from "types"
|
||||
|
||||
export function get_build_deps(dry: Set<string>) {
|
||||
const pantry = usePantry()
|
||||
|
||||
return async (pkg: PackageRequirement) => {
|
||||
const deps = await pantry.getDeps(pkg)
|
||||
if (dry.has(pkg.project)) {
|
||||
// we hydrate the runtime deps of any build deps since if
|
||||
// any of `dry` is a runtime dep of any build dep (obv. from another)
|
||||
// pkg in the set we are building then it needs to be sorted first
|
||||
return [...deps.runtime, ...deps.build]
|
||||
} else {
|
||||
return deps.runtime
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,6 +23,12 @@ import { semver, PackageRequirement, Package } from "types"
|
|||
import { parsePackageRequirement } from "types"
|
||||
import hydrate from "prefab/hydrate.ts"
|
||||
import resolve from "prefab/resolve.ts"
|
||||
import { get_build_deps } from "./_lib.ts"
|
||||
|
||||
//<FIXME>
|
||||
import { print } from "utils"
|
||||
print("this because otherwise console.verbose is not defined lol")
|
||||
//</FIXME>
|
||||
|
||||
const pantry = usePantry()
|
||||
const cellar = useCellar()
|
||||
|
@ -32,20 +38,10 @@ const dry = Deno.args.map(project => {
|
|||
return match ? match[1] : project
|
||||
}).map(parsePackageRequirement)
|
||||
|
||||
//FIXME this isn’t as specific as we are above
|
||||
const explicit_deps = new Set(dry.map(({ project }) => project))
|
||||
|
||||
const build_deps = await (async () => {
|
||||
const rv: PackageRequirement[] = []
|
||||
for (const pkg of dry) {
|
||||
const foo = await pantry.getDeps(pkg)
|
||||
rv.push(...foo.build)
|
||||
}
|
||||
return rv
|
||||
})()
|
||||
|
||||
const wet = await hydrate([...dry, ...build_deps])
|
||||
const gas = await resolve(await (async () => {
|
||||
const wet = await hydrate(dry, get_build_deps(explicit_deps))
|
||||
const gas = async () => {
|
||||
const rv: PackageRequirement[] = []
|
||||
for (const pkg of wet) {
|
||||
if (await cellar.isInstalled(pkg)) continue
|
||||
|
@ -53,9 +49,10 @@ const gas = await resolve(await (async () => {
|
|||
rv.push(pkg)
|
||||
}
|
||||
return rv
|
||||
})())
|
||||
}
|
||||
const plasma = await resolve(await gas())
|
||||
|
||||
for await (const pkg of gas) {
|
||||
for await (const pkg of plasma) {
|
||||
console.log({ installing: pkg.project })
|
||||
const installation = install(pkg)
|
||||
await link(installation)
|
||||
|
|
|
@ -13,37 +13,22 @@ args:
|
|||
---*/
|
||||
|
||||
import { parsePackageRequirement } from "types"
|
||||
import usePantry from "hooks/usePantry.ts"
|
||||
import hydrate from "prefab/hydrate.ts"
|
||||
import { get_build_deps } from "./_lib.ts"
|
||||
|
||||
//<FIXME>
|
||||
import { print } from "utils"
|
||||
print("this because otherwise console.verbose is not defined lol")
|
||||
//</FIXME>
|
||||
|
||||
const dry = Deno.args.map(project => {
|
||||
const match = project.match(/projects\/(.*)\/package.yml/)
|
||||
return match ? match[1] : project
|
||||
}).map(parsePackageRequirement)
|
||||
|
||||
const cum: string[] = []
|
||||
const set = new Set(dry.map(x => x.project))
|
||||
const wet = await hydrate(dry, get_build_deps(set))
|
||||
const gas = wet.map(x => x.project)
|
||||
.filter(x => set.has(x)) // we're only sorting `dry` so reject the rest
|
||||
|
||||
const pantry = usePantry()
|
||||
|
||||
for (const pkg of dry) {
|
||||
const deps = await pantry.getDeps(pkg)
|
||||
const wet = await hydrate([...deps.runtime, ...deps.build])
|
||||
for (const {project: dep} of wet) {
|
||||
if (set.has(dep)) {
|
||||
cum.push(dep)
|
||||
}
|
||||
}
|
||||
cum.push(pkg.project)
|
||||
}
|
||||
|
||||
const rv = new Array<string>()
|
||||
const newset = new Set()
|
||||
for (const pkg of cum) {
|
||||
if (!newset.has(pkg)) {
|
||||
rv.push(pkg)
|
||||
newset.add(pkg)
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`::set-output name=pkgs::${rv.join(" ")}`)
|
||||
console.log(`::set-output name=pkgs::${gas.join(" ")}`)
|
||||
|
|
|
@ -15,7 +15,7 @@ args:
|
|||
import { parsePackage, semver, Path, PackageRequirement, PlainObject } from "types"
|
||||
import usePantry from "hooks/usePantry.ts"
|
||||
import useShellEnv, { expand } from "hooks/useShellEnv.ts"
|
||||
import { run, undent, isPlainObject, isString } from "utils"
|
||||
import { run, undent, isPlainObject } from "utils"
|
||||
import { validatePackageRequirement } from "utils/lvl2.ts"
|
||||
|
||||
//TODO install any other deps
|
||||
|
|
Loading…
Reference in a new issue