mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 15:34:18 +08:00
Merge remote-tracking branch 'cookbook/master' into merge-cookbook
This commit is contained in:
commit
e4776da297
26
.cargo/config.toml
Normal file
26
.cargo/config.toml
Normal file
@ -0,0 +1,26 @@
|
||||
[target.aarch64-unknown-redox]
|
||||
linker = "aarch64-unknown-redox-gcc"
|
||||
rustflags = []
|
||||
|
||||
[target.i586-unknown-redox]
|
||||
linker = "i586-unknown-redox-gcc"
|
||||
rustflags = []
|
||||
|
||||
[target.i686-unknown-redox]
|
||||
linker = "i686-unknown-redox-gcc"
|
||||
rustflags = []
|
||||
|
||||
[target.x86_64-unknown-redox]
|
||||
linker = "x86_64-unknown-redox-gcc"
|
||||
rustflags = []
|
||||
|
||||
[target.riscv64gc-unknown-redox]
|
||||
linker = "riscv64-unknown-redox-gcc"
|
||||
rustflags = []
|
||||
|
||||
[env]
|
||||
CFLAGS_riscv64gc_unknown_redox="-march=rv64gc -mabi=lp64d"
|
||||
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
linker = "x86_64-linux-gnu-gcc"
|
||||
rustflags = []
|
||||
11
.gitignore
vendored
11
.gitignore
vendored
@ -10,3 +10,14 @@
|
||||
.vscode/
|
||||
# Local settings folder for the devcontainer extension that most IDEs support.
|
||||
.devcontainer/
|
||||
# Cookbook
|
||||
/repo
|
||||
/cookbook.toml
|
||||
source
|
||||
source.tmp
|
||||
source-new
|
||||
source-old
|
||||
source.tar
|
||||
source.tar.tmp
|
||||
target
|
||||
wget-log
|
||||
|
||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -2,6 +2,10 @@
|
||||
path = cookbook
|
||||
url = https://gitlab.redox-os.org/redox-os/cookbook.git
|
||||
branch = master
|
||||
[submodule "pkgar"]
|
||||
path = pkgar
|
||||
url = https://gitlab.redox-os.org/redox-os/pkgar.git
|
||||
branch = master
|
||||
[submodule "rust"]
|
||||
path = rust
|
||||
url = https://gitlab.redox-os.org/redox-os/rust.git
|
||||
|
||||
3671
Cargo.lock
generated
Normal file
3671
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
58
Cargo.toml
Normal file
58
Cargo.toml
Normal file
@ -0,0 +1,58 @@
|
||||
[package]
|
||||
name = "redox_cookbook"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
edition = "2024"
|
||||
default-run = "repo"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[[bin]]
|
||||
name = "cook"
|
||||
path = "src/bin/cook.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "cookbook_redoxer"
|
||||
path = "src/bin/cookbook_redoxer.rs"
|
||||
|
||||
[lib]
|
||||
name = "cookbook"
|
||||
path = "src/lib.rs"
|
||||
doctest = false
|
||||
|
||||
[features]
|
||||
#TODO: Actually make without tui feature works
|
||||
default = ["tui"]
|
||||
tui = ["ratatui", "ansi-to-tui", "filedescriptor", "strip-ansi-escapes"]
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
# blake3 1.5.4 is incompatible with 0.3 dependency from pkgar
|
||||
blake3 = "=1.5.3"
|
||||
libc = "0.2"
|
||||
ignore = "0.4"
|
||||
object = { version = "0.36", features = ["build_core"] }
|
||||
pbr = "1.0.2"
|
||||
pkgar = { path = "pkgar/pkgar" }
|
||||
pkgar-core = { path = "pkgar/pkgar-core" }
|
||||
pkgar-keys = { path = "pkgar/pkgar-keys" }
|
||||
redox-pkg = "0.2.8"
|
||||
redox_installer = "0.2.37"
|
||||
redoxer = "0.2.60"
|
||||
regex = "1.11"
|
||||
serde = { version = "=1.0.197", features = ["derive"] }
|
||||
termion = "4"
|
||||
toml = "0.8"
|
||||
walkdir = "2.3.1"
|
||||
filedescriptor = { version = "0.8.3", optional = true }
|
||||
ansi-to-tui = { version = "7.0.0", optional = true }
|
||||
strip-ansi-escapes = { version = "0.2.1", optional = true }
|
||||
|
||||
[dependencies.ratatui]
|
||||
version = "0.29.0"
|
||||
default-features = false
|
||||
features = ["termion"]
|
||||
optional = true
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3"
|
||||
12
bin/aarch64-unknown-redox-pkg-config
Executable file
12
bin/aarch64-unknown-redox-pkg-config
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
||||
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
||||
|
||||
if [ -n "${COOKBOOK_DYNAMIC}" ]
|
||||
then
|
||||
exec pkg-config "$@"
|
||||
else
|
||||
exec pkg-config --static "$@"
|
||||
fi
|
||||
12
bin/i586-unknown-redox-pkg-config
Executable file
12
bin/i586-unknown-redox-pkg-config
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
||||
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
||||
|
||||
if [ -n "${COOKBOOK_DYNAMIC}" ]
|
||||
then
|
||||
exec pkg-config "$@"
|
||||
else
|
||||
exec pkg-config --static "$@"
|
||||
fi
|
||||
12
bin/i686-unknown-redox-pkg-config
Executable file
12
bin/i686-unknown-redox-pkg-config
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
||||
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
||||
|
||||
if [ -n "${COOKBOOK_DYNAMIC}" ]
|
||||
then
|
||||
exec pkg-config "$@"
|
||||
else
|
||||
exec pkg-config --static "$@"
|
||||
fi
|
||||
12
bin/riscv64-unknown-redox-pkg-config
Executable file
12
bin/riscv64-unknown-redox-pkg-config
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
||||
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
||||
|
||||
if [ -n "${COOKBOOK_DYNAMIC}" ]
|
||||
then
|
||||
exec pkg-config "$@"
|
||||
else
|
||||
exec pkg-config --static "$@"
|
||||
fi
|
||||
173
bin/x86_64-unknown-redox-llvm-config
Executable file
173
bin/x86_64-unknown-redox-llvm-config
Executable file
@ -0,0 +1,173 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# The values here are copied from the output of llvm-config running under Redox.
|
||||
# This is a hack, and should be replaced if possible.
|
||||
|
||||
# generated with this ion script:
|
||||
# for component in @(llvm-config --components)
|
||||
# echo -e \"$component\": \"$(llvm-config --libs $component)\",
|
||||
# end
|
||||
components = {
|
||||
'aggressiveinstcombine': '-lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'all': '-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver -lLLVMTextAPIBinaryReader -lLLVMCoverage -lLLVMLineEditor -lLLVMX86TargetMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMOrcDebugging -lLLVMOrcJIT -lLLVMWindowsDriver -lLLVMMCJIT -lLLVMJITLink -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMDWP -lLLVMDebugInfoLogicalView -lLLVMDebugInfoGSYM -lLLVMOption -lLLVMObjectYAML -lLLVMObjCopy -lLLVMMCA -lLLVMMCDisassembler -lLLVMLTO -lLLVMPasses -lLLVMHipStdPar -lLLVMCFGuard -lLLVMCoroutines -lLLVMipo -lLLVMVectorize -lLLVMLinker -lLLVMInstrumentation -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMFrontendOpenACC -lLLVMFrontendHLSL -lLLVMFrontendDriver -lLLVMExtensions -lLLVMDWARFLinkerParallel -lLLVMDWARFLinkerClassic -lLLVMDWARFLinker -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG -lLLVMCodeGen -lLLVMTarget -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMIRPrinter -lLLVMInterfaceStub -lLLVMFileCheck -lLLVMFuzzMutate -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMFuzzerCLI -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMTableGen -lLLVMSupport -lLLVMDemangle',
|
||||
'all-targets': '-lLLVMX86TargetMCA -lLLVMMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMInstrumentation -lLLVMIRPrinter -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMCFGuard -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'analysis': '-lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'asmparser': '-lLLVMAsmParser -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'asmprinter': '-lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'binaryformat': '-lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'bitreader': '-lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMBitstreamReader -lLLVMSupport -lLLVMDemangle',
|
||||
'bitstreamreader': '-lLLVMBitstreamReader -lLLVMSupport -lLLVMDemangle',
|
||||
'bitwriter': '-lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'cfguard': '-lLLVMCFGuard -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'codegen': '-lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'codegentypes': '-lLLVMCodeGenTypes -lLLVMSupport -lLLVMDemangle',
|
||||
'core': '-lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'coroutines': '-lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMScalarOpts -lLLVMInstCombine -lLLVMBitWriter -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'coverage': '-lLLVMCoverage -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'debuginfobtf': '-lLLVMDebugInfoBTF -lLLVMSupport -lLLVMDemangle',
|
||||
'debuginfocodeview': '-lLLVMDebugInfoCodeView -lLLVMSupport -lLLVMDemangle',
|
||||
'debuginfodwarf': '-lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'debuginfogsym': '-lLLVMDebugInfoGSYM -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'debuginfologicalview': '-lLLVMDebugInfoLogicalView -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'debuginfomsf': '-lLLVMDebugInfoMSF -lLLVMSupport -lLLVMDemangle',
|
||||
'debuginfopdb': '-lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'demangle': '-lLLVMDemangle',
|
||||
'dlltooldriver': '-lLLVMDlltoolDriver -lLLVMOption -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMBitstreamReader -lLLVMSupport -lLLVMDemangle',
|
||||
'dwarflinker': '-lLLVMDWARFLinker -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'dwarflinkerclassic': '-lLLVMDWARFLinkerClassic -lLLVMDWARFLinker -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'dwarflinkerparallel': '-lLLVMDWARFLinkerParallel -lLLVMDWARFLinker -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'dwp': '-lLLVMDWP -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'engine': '-lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'executionengine': '-lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMBitReader -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'extensions': '-lLLVMExtensions -lLLVMSupport -lLLVMDemangle',
|
||||
'filecheck': '-lLLVMFileCheck',
|
||||
'frontenddriver': '-lLLVMFrontendDriver -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'frontendhlsl': '-lLLVMFrontendHLSL -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'frontendoffloading': '-lLLVMFrontendOffloading -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'frontendopenacc': '-lLLVMFrontendOpenACC',
|
||||
'frontendopenmp': '-lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'fuzzercli': '-lLLVMFuzzerCLI -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'fuzzmutate': '-lLLVMFuzzMutate -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'globalisel': '-lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'hipstdpar': '-lLLVMHipStdPar -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'instcombine': '-lLLVMInstCombine -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'instrumentation': '-lLLVMInstrumentation -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'interfacestub': '-lLLVMInterfaceStub -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'interpreter': '-lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'ipo': '-lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMScalarOpts -lLLVMInstCombine -lLLVMBitWriter -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'irprinter': '-lLLVMIRPrinter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'irreader': '-lLLVMIRReader -lLLVMBitReader -lLLVMAsmParser -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'jitlink': '-lLLVMJITLink -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMOption -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'libdriver': '-lLLVMLibDriver -lLLVMOption -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'lineeditor': '-lLLVMLineEditor -lLLVMSupport -lLLVMDemangle',
|
||||
'linker': '-lLLVMLinker -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'lto': '-lLLVMLTO -lLLVMPasses -lLLVMIRPrinter -lLLVMHipStdPar -lLLVMCoroutines -lLLVMCFGuard -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMExtensions -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'mc': '-lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'mca': '-lLLVMMCA -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'mcdisassembler': '-lLLVMMCDisassembler -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'mcjit': '-lLLVMMCJIT -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMBitReader -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'mcparser': '-lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'mirparser': '-lLLVMMIRParser -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMAsmParser -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'native': '-lLLVMX86TargetMCA -lLLVMMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMInstrumentation -lLLVMIRPrinter -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMCFGuard -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'nativecodegen': '-lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMInstrumentation -lLLVMIRPrinter -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMCFGuard -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'objcarcopts': '-lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'objcopy': '-lLLVMObjCopy -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'object': '-lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMBitstreamReader -lLLVMSupport -lLLVMDemangle',
|
||||
'objectyaml': '-lLLVMObjectYAML -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'option': '-lLLVMOption -lLLVMSupport -lLLVMDemangle',
|
||||
'orcdebugging': '-lLLVMOrcDebugging -lLLVMOrcJIT -lLLVMPasses -lLLVMIRPrinter -lLLVMHipStdPar -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMCFGuard -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMWindowsDriver -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMRuntimeDyld -lLLVMJITLink -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMOption -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'orcjit': '-lLLVMOrcJIT -lLLVMPasses -lLLVMIRPrinter -lLLVMHipStdPar -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMCFGuard -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMWindowsDriver -lLLVMJITLink -lLLVMOption -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMBitReader -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'orcshared': '-lLLVMOrcShared -lLLVMSupport -lLLVMDemangle',
|
||||
'orctargetprocess': '-lLLVMOrcTargetProcess -lLLVMTargetParser -lLLVMOrcShared -lLLVMSupport -lLLVMDemangle',
|
||||
'passes': '-lLLVMPasses -lLLVMIRPrinter -lLLVMHipStdPar -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMCFGuard -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'profiledata': '-lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'remarks': '-lLLVMRemarks -lLLVMBitstreamReader -lLLVMSupport -lLLVMDemangle',
|
||||
'runtimedyld': '-lLLVMRuntimeDyld -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMBitReader -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'scalaropts': '-lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'selectiondag': '-lLLVMSelectionDAG -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'support': '-lLLVMSupport -lLLVMDemangle',
|
||||
'symbolize': '-lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'tablegen': '-lLLVMTableGen -lLLVMSupport -lLLVMDemangle',
|
||||
'target': '-lLLVMTarget -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'targetparser': '-lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'textapi': '-lLLVMTextAPI -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'textapibinaryreader': '-lLLVMTextAPIBinaryReader -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMBitstreamReader -lLLVMSupport -lLLVMDemangle',
|
||||
'transformutils': '-lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'vectorize': '-lLLVMVectorize -lLLVMTransformUtils -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'windowsdriver': '-lLLVMWindowsDriver -lLLVMTargetParser -lLLVMOption -lLLVMSupport -lLLVMDemangle',
|
||||
'windowsmanifest': '-lLLVMWindowsManifest -lLLVMSupport -lLLVMDemangle',
|
||||
'x86': '-lLLVMX86TargetMCA -lLLVMMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMInstrumentation -lLLVMIRPrinter -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMCFGuard -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'x86asmparser': '-lLLVMX86AsmParser -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMCodeGenTypes -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'x86codegen': '-lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMInstrumentation -lLLVMIRPrinter -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMCFGuard -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMObjCARCOpts -lLLVMTransformUtils -lLLVMCodeGenTypes -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'x86desc': '-lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMCodeGenTypes -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'x86disassembler': '-lLLVMX86Disassembler -lLLVMX86Info -lLLVMMCDisassembler -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'x86info': '-lLLVMX86Info -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle',
|
||||
'x86targetmca': '-lLLVMX86TargetMCA -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMMCParser -lLLVMMCA -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMCodeGenTypes -lLLVMSupport -lLLVMDemangle',
|
||||
'xray': '-lLLVMXRay -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMBitstreamReader -lLLVMSupport -lLLVMDemangle',
|
||||
}
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
def fail(message):
|
||||
print("redox llvm-config failure", file=sys.stderr)
|
||||
print(message, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
prefix = os.environ["COOKBOOK_SYSROOT"]
|
||||
|
||||
args = []
|
||||
link_static = False
|
||||
for arg in sys.argv[1:]:
|
||||
if arg == "--link-static":
|
||||
link_static = True
|
||||
elif arg == "--link-shared":
|
||||
fail("shared linking disabled")
|
||||
else:
|
||||
args.append(arg)
|
||||
|
||||
if args == []:
|
||||
fail("no arguments")
|
||||
elif args == ["--version"]:
|
||||
print("18.1.4")
|
||||
elif args == ["--bindir"]:
|
||||
print(prefix + "/bin")
|
||||
elif args == ["--cppflags"]:
|
||||
print("-I" + prefix + "/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
|
||||
elif args == ["--cxxflags"]:
|
||||
print("-I" + prefix + "/include --std=c++17 -fno-exceptions -funwind-tables -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
|
||||
elif args == ["--components"]:
|
||||
print(" ".join(components.keys()))
|
||||
elif args == ["--includedir"]:
|
||||
print(prefix + "/include")
|
||||
elif args == ["--ldflags"]:
|
||||
print("-L" + prefix + "/lib");
|
||||
elif args == ["--libdir"]:
|
||||
print(prefix + "/lib")
|
||||
elif args == ["--system-libs"]:
|
||||
print("-lm")
|
||||
elif args == ["--targets-built"]:
|
||||
print("X86")
|
||||
elif args[0] == "--libs":
|
||||
libs = []
|
||||
if len(args) == 1:
|
||||
args.append("all")
|
||||
for component in args[1:]:
|
||||
for lib in components[component].split(" "):
|
||||
libs.append(lib)
|
||||
print(" ".join(libs))
|
||||
elif args[0] == "--libfiles":
|
||||
libs = []
|
||||
if len(args) == 1:
|
||||
args.append("all")
|
||||
for component in args[1:]:
|
||||
for lib in components[component].split(" "):
|
||||
file = prefix + "/lib/lib" + lib[2:] + ".a"
|
||||
libs.append(file)
|
||||
print(" ".join(libs))
|
||||
elif args == ["--has-rtti"]:
|
||||
print("YES")
|
||||
elif args[0] == "--shared-mode":
|
||||
print("static")
|
||||
else:
|
||||
fail("unknown arguments: " + " ".join(args))
|
||||
12
bin/x86_64-unknown-redox-pkg-config
Executable file
12
bin/x86_64-unknown-redox-pkg-config
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
||||
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
||||
|
||||
if [ -n "${COOKBOOK_DYNAMIC}" ]
|
||||
then
|
||||
exec pkg-config "$@"
|
||||
else
|
||||
exec pkg-config --static "$@"
|
||||
fi
|
||||
78
config.sh
Executable file
78
config.sh
Executable file
@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Configuration
|
||||
if [ -z "${TARGET}" ]
|
||||
then
|
||||
export TARGET=x86_64-unknown-redox
|
||||
fi
|
||||
if [ $(uname -s) = 'Redox' ]
|
||||
then
|
||||
export IS_REDOX="1"
|
||||
fi
|
||||
|
||||
ARCH="${TARGET%%-*}"
|
||||
HOST="$TARGET"
|
||||
if [ x"${HOST}" == x"riscv64gc-unknown-redox" ] ; then
|
||||
HOST="riscv64-unknown-redox"
|
||||
fi
|
||||
|
||||
# Cookbook requires correct CWD to work
|
||||
cd `dirname "$0"`
|
||||
|
||||
# Automatic variables
|
||||
ROOT=`pwd`
|
||||
|
||||
export AR="${HOST}-gcc-ar"
|
||||
export AS="${HOST}-as"
|
||||
export CC="${HOST}-gcc"
|
||||
export CXX="${HOST}-g++"
|
||||
export LD="${HOST}-ld"
|
||||
export NM="${HOST}-gcc-nm"
|
||||
export OBJCOPY="${HOST}-objcopy"
|
||||
export OBJDUMP="${HOST}-objdump"
|
||||
export PKG_CONFIG="${HOST}-pkg-config"
|
||||
export RANLIB="${HOST}-gcc-ranlib"
|
||||
export READELF="${HOST}-readelf"
|
||||
export STRIP="${HOST}-strip"
|
||||
|
||||
if [ -n "${CC_WRAPPER}" ]
|
||||
then
|
||||
export CC="${CC_WRAPPER} ${CC}"
|
||||
export CXX="${CC_WRAPPER} ${CXX}"
|
||||
fi
|
||||
|
||||
BUILD="$(cc -dumpmachine)"
|
||||
|
||||
export PKG_CONFIG_FOR_BUILD="pkg-config"
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "FreeBSD" ]]; then
|
||||
# GNU find
|
||||
FIND="gfind";
|
||||
else
|
||||
FIND="find";
|
||||
fi
|
||||
|
||||
export FIND
|
||||
|
||||
if [ -z "${IS_REDOX}" ]
|
||||
then
|
||||
function pkgar {
|
||||
"$ROOT/pkgar/target/release/pkgar" "$@"
|
||||
}
|
||||
function cook {
|
||||
"$ROOT/target/release/cook" "$@"
|
||||
}
|
||||
function repo {
|
||||
"$ROOT/target/release/repo" "$@"
|
||||
}
|
||||
function repo_builder {
|
||||
"$ROOT/target/release/repo_builder" "$@"
|
||||
}
|
||||
function list_recipes {
|
||||
"$ROOT/target/release/list_recipes" "$@"
|
||||
}
|
||||
function find_recipe {
|
||||
"$ROOT/target/release/find_recipe" "$@"
|
||||
}
|
||||
fi
|
||||
1
pkgar
Submodule
1
pkgar
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 98aecac8d40b6a47429e2a5585416ad90c02e6db
|
||||
15
recipes/archives/lz4/recipe.toml
Normal file
15
recipes/archives/lz4/recipe.toml
Normal file
@ -0,0 +1,15 @@
|
||||
[source]
|
||||
tar = "https://github.com/lz4/lz4/releases/download/v1.10.0/lz4-1.10.0.tar.gz"
|
||||
blake3 = "3e69fd475e7852e17594985528b5232afeba7d3d56cfebe2e89071768b2ab36a"
|
||||
patches = ["redox.patch"]
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
|
||||
export CPPFLAGS="${CPPFLAGS} -D_REDOX"
|
||||
|
||||
${COOKBOOK_MAKE} prefix="/usr"
|
||||
${COOKBOOK_MAKE} install DESTDIR="${COOKBOOK_STAGE}" prefix="/usr"
|
||||
"""
|
||||
34
recipes/archives/lz4/redox.patch
Normal file
34
recipes/archives/lz4/redox.patch
Normal file
@ -0,0 +1,34 @@
|
||||
diff '--color=auto' -ruwN source/programs/util.h source-new/programs/util.h
|
||||
--- source/programs/util.h 2024-07-21 13:29:49.000000000 -0400
|
||||
+++ source-new/programs/util.h 2024-12-13 02:21:03.032769559 -0500
|
||||
@@ -52,6 +52,9 @@
|
||||
#include <time.h> /* time */
|
||||
#include <limits.h> /* INT_MAX */
|
||||
#include <errno.h>
|
||||
+#if defined(_REDOX)
|
||||
+# include <sys/time.h> /* utimes */
|
||||
+#endif
|
||||
|
||||
|
||||
|
||||
@@ -239,12 +242,20 @@
|
||||
timebuf.modtime = statbuf->st_mtime;
|
||||
res += utime(filename, &timebuf); /* set access and modification times */
|
||||
#else
|
||||
+ #if defined(_REDOX)
|
||||
+ struct timeval timebuf[2];
|
||||
+ memset(timebuf, 0, sizeof(timebuf));
|
||||
+ timebuf[0].tv_usec = UTIME_NOW;
|
||||
+ timebuf[1].tv_sec = statbuf->st_mtime;
|
||||
+ res += utimes(filename, timebuf);
|
||||
+ #else
|
||||
struct timespec timebuf[2];
|
||||
memset(timebuf, 0, sizeof(timebuf));
|
||||
timebuf[0].tv_nsec = UTIME_NOW;
|
||||
timebuf[1].tv_sec = statbuf->st_mtime;
|
||||
res += utimensat(AT_FDCWD, filename, timebuf, 0); /* set access and modification times */
|
||||
#endif
|
||||
+#endif
|
||||
}
|
||||
|
||||
#if !defined(_WIN32)
|
||||
15
recipes/archives/zstd/01_redox.patch
Normal file
15
recipes/archives/zstd/01_redox.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff -ruwN source/programs/platform.h source-new/programs/platform.h
|
||||
--- source/programs/platform.h 2025-02-19 07:04:24.000000000 +0700
|
||||
+++ source-new/programs/platform.h 2025-07-21 22:52:07.716447723 +0700
|
||||
@@ -109,6 +109,11 @@
|
||||
#endif /* PLATFORM_POSIX_VERSION */
|
||||
|
||||
|
||||
+#if defined(__redox__)
|
||||
+/* TODO: AT_FDCWD && utimensat must be defined to conform _POSIX_VERSION */
|
||||
+# define PLATFORM_POSIX_VERSION 1
|
||||
+#endif
|
||||
+
|
||||
#if PLATFORM_POSIX_VERSION > 1
|
||||
/* glibc < 2.26 may not expose struct timespec def without this.
|
||||
* See issue #1920. */
|
||||
13
recipes/archives/zstd/recipe.toml
Normal file
13
recipes/archives/zstd/recipe.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[source]
|
||||
tar = "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz"
|
||||
patches = [
|
||||
"01_redox.patch"
|
||||
]
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
|
||||
${COOKBOOK_MAKE}
|
||||
${COOKBOOK_MAKE} install DESTDIR="${COOKBOOK_STAGE}" prefix="/usr"
|
||||
"""
|
||||
8
recipes/artwork/pop-wallpapers/recipe.toml
Normal file
8
recipes/artwork/pop-wallpapers/recipe.toml
Normal file
@ -0,0 +1,8 @@
|
||||
[source]
|
||||
git = "https://github.com/pop-os/wallpapers"
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
mkdir -pv "${COOKBOOK_STAGE}"/usr/share/wallpapers
|
||||
cp -rv "${COOKBOOK_SOURCE}"/original/* "${COOKBOOK_STAGE}"/usr/share/wallpapers
|
||||
"""
|
||||
9
recipes/artwork/ubuntu-wallpapers/recipe.toml
Normal file
9
recipes/artwork/ubuntu-wallpapers/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
tar = "https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/ubuntu-wallpapers/23.10.4/ubuntu-wallpapers_23.10.4.orig.tar.gz"
|
||||
blake3 = "1e479d0aa48fe3f2961a2dac28c3ed397a29616cf6e7d73f5ceb6fabfd6449e1"
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
mkdir -pv "${COOKBOOK_STAGE}"/usr/share/wallpapers
|
||||
cp -rv "${COOKBOOK_SOURCE}"/ubuntu-wallpapers-23.10.4/*.{jpg,png} "${COOKBOOK_STAGE}"/usr/share/wallpapers
|
||||
"""
|
||||
@ -0,0 +1,3 @@
|
||||
hwd
|
||||
pcid
|
||||
pcid-spawner /etc/pcid/initfs.toml
|
||||
@ -0,0 +1 @@
|
||||
bcm2835-sdhcid
|
||||
40
recipes/core/base-initfs/init.rc
Normal file
40
recipes/core/base-initfs/init.rc
Normal file
@ -0,0 +1,40 @@
|
||||
# Various daemons that relibc needs to function as well as a bunch of env vars
|
||||
# that should be set for every program.
|
||||
export PATH /bin
|
||||
export RUST_BACKTRACE 1
|
||||
rtcd
|
||||
nulld
|
||||
zerod
|
||||
randd
|
||||
|
||||
# Logging
|
||||
logd
|
||||
stdio /scheme/log
|
||||
ramfs logging
|
||||
|
||||
# Graphics infrastructure
|
||||
inputd
|
||||
vesad
|
||||
unset FRAMEBUFFER_ADDR FRAMEBUFFER_VIRT FRAMEBUFFER_WIDTH FRAMEBUFFER_HEIGHT FRAMEBUFFER_STRIDE
|
||||
#TODO: unset FRAMEBUFFER1 and beyond?
|
||||
fbbootlogd
|
||||
inputd -A 1
|
||||
fbcond 2
|
||||
|
||||
# Live disk
|
||||
# Note: Needs to start before drivers to ensure it gets priority when redoxfs searches for disks
|
||||
lived
|
||||
|
||||
# Drivers
|
||||
run /scheme/initfs/etc/init_drivers.rc
|
||||
unset RSDP_ADDR RSDP_SIZE
|
||||
|
||||
# Mount rootfs
|
||||
redoxfs --uuid $REDOXFS_UUID file $REDOXFS_BLOCK
|
||||
unset REDOXFS_UUID REDOXFS_BLOCK REDOXFS_PASSWORD_ADDR REDOXFS_PASSWORD_SIZE
|
||||
|
||||
# Exit initfs
|
||||
set-default-scheme file
|
||||
cd /
|
||||
export PATH /usr/bin
|
||||
run.d /usr/lib/init.d /etc/init.d
|
||||
4
recipes/core/base-initfs/init_drivers.rc
Normal file
4
recipes/core/base-initfs/init_drivers.rc
Normal file
@ -0,0 +1,4 @@
|
||||
ps2d us
|
||||
hwd
|
||||
pcid
|
||||
pcid-spawner /etc/pcid/initfs.toml
|
||||
73
recipes/core/base-initfs/recipe.toml
Normal file
73
recipes/core/base-initfs/recipe.toml
Normal file
@ -0,0 +1,73 @@
|
||||
[source]
|
||||
same_as = "../base"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"drivers-initfs",
|
||||
"redoxfs",
|
||||
]
|
||||
script = """
|
||||
INITFS_RM_BINS='redoxfs-ar redoxfs-mkfs'
|
||||
|
||||
rm -rf "${COOKBOOK_BUILD}/initfs"
|
||||
mkdir -p "${COOKBOOK_BUILD}/initfs/etc"
|
||||
|
||||
cp -r "${COOKBOOK_SYSROOT}/"* "${COOKBOOK_BUILD}/initfs"
|
||||
|
||||
# TODO: Move init.rc to another recipe, perhaps initfs-misc? Then it can be installed as a regular dependency.
|
||||
cp "${COOKBOOK_RECIPE}/init.rc" "${COOKBOOK_BUILD}/initfs/etc/init.rc"
|
||||
cp "${COOKBOOK_RECIPE}/init_drivers.rc" "${COOKBOOK_BUILD}/initfs/etc/init_drivers.rc"
|
||||
if [ -e ${COOKBOOK_RECIPE}/${TARGET}/init_drivers.rc.${BOARD} ]; then
|
||||
cp "${COOKBOOK_RECIPE}/${TARGET}/init_drivers.rc.${BOARD}" "${COOKBOOK_BUILD}/initfs/etc/init_drivers.rc"
|
||||
elif [ -e ${COOKBOOK_RECIPE}/${TARGET}/init_drivers.rc ]; then
|
||||
cp "${COOKBOOK_RECIPE}/${TARGET}/init_drivers.rc" "${COOKBOOK_BUILD}/initfs/etc/init_drivers.rc"
|
||||
fi
|
||||
|
||||
# Move /usr folders to / and remove links
|
||||
for folder in bin lib include share
|
||||
do
|
||||
rm "${COOKBOOK_BUILD}/initfs/${folder}"
|
||||
mv "${COOKBOOK_BUILD}/initfs/usr/${folder}" "${COOKBOOK_BUILD}/initfs/${folder}"
|
||||
done
|
||||
rmdir "${COOKBOOK_BUILD}/initfs/usr"
|
||||
|
||||
for bin in ${INITFS_RM_BINS}; do
|
||||
rm -f "${COOKBOOK_BUILD}/initfs/bin/$bin"
|
||||
done
|
||||
|
||||
mkdir -pv "${COOKBOOK_BUILD}/initfs/bin"
|
||||
for package in init logd ramfs randd zerod; do
|
||||
"${COOKBOOK_CARGO}" build \
|
||||
--manifest-path "${COOKBOOK_SOURCE}/${package}/Cargo.toml" \
|
||||
${build_flags}
|
||||
cp -v \
|
||||
"target/${TARGET}/${build_type}/${package}" \
|
||||
"${COOKBOOK_BUILD}/initfs/bin/${package}"
|
||||
done
|
||||
|
||||
# TODO: symlinks aren't supported by redox-initfs
|
||||
#ln -sv zerod "${COOKBOOK_BUILD}/initfs/bin/nulld"
|
||||
|
||||
cp "${COOKBOOK_BUILD}/initfs/bin/zerod" "${COOKBOOK_BUILD}/initfs/bin/nulld"
|
||||
|
||||
ARCH="$(echo "${GNU_TARGET}" | cut -d - -f1)"
|
||||
cargo \
|
||||
-Zbuild-std=core,alloc,compiler_builtins \
|
||||
-Zbuild-std-features=compiler-builtins-mem build \
|
||||
--target "${TARGET}" \
|
||||
--manifest-path "${COOKBOOK_SOURCE}/bootstrap/Cargo.toml" \
|
||||
--release \
|
||||
--target-dir "${COOKBOOK_BUILD}"
|
||||
"${GNU_TARGET}-ld" \
|
||||
-o "${COOKBOOK_BUILD}/bootstrap" \
|
||||
--gc-sections \
|
||||
-T "${COOKBOOK_SOURCE}/bootstrap/src/${ARCH}.ld" \
|
||||
-z max-page-size=4096 \
|
||||
"${COOKBOOK_BUILD}/${TARGET}/release/libbootstrap.a"
|
||||
|
||||
env -u CARGO cargo run --manifest-path "${COOKBOOK_SOURCE}/initfs/tools/Cargo.toml" --bin redox-initfs-ar -- "${COOKBOOK_BUILD}/initfs" "${COOKBOOK_BUILD}/bootstrap" -o "${COOKBOOK_BUILD}/initfs.img"
|
||||
|
||||
mkdir -v "${COOKBOOK_STAGE}/boot"
|
||||
cp "${COOKBOOK_BUILD}/initfs.img" "${COOKBOOK_STAGE}/boot/initfs"
|
||||
"""
|
||||
23
recipes/core/base/recipe.toml
Normal file
23
recipes/core/base/recipe.toml
Normal file
@ -0,0 +1,23 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/base.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
mkdir -pv "${COOKBOOK_STAGE}/usr/bin"
|
||||
for package in audiod ipcd ptyd; do
|
||||
"${COOKBOOK_CARGO}" build \
|
||||
--manifest-path "${COOKBOOK_SOURCE}/${package}/Cargo.toml" \
|
||||
${build_flags}
|
||||
cp -v \
|
||||
"target/${TARGET}/${build_type}/${package}" \
|
||||
"${COOKBOOK_STAGE}/usr/bin/${package}"
|
||||
done
|
||||
|
||||
"${COOKBOOK_CARGO}" build \
|
||||
--manifest-path "${COOKBOOK_SOURCE}/netstack/Cargo.toml" \
|
||||
${build_flags}
|
||||
cp -v \
|
||||
"target/${TARGET}/${build_type}/smolnetd" \
|
||||
"${COOKBOOK_STAGE}/usr/bin/smolnetd"
|
||||
"""
|
||||
5
recipes/core/binutils/recipe.toml
Normal file
5
recipes/core/binutils/recipe.toml
Normal file
@ -0,0 +1,5 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/binutils.git"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
33
recipes/core/bootloader/recipe.toml
Normal file
33
recipes/core/bootloader/recipe.toml
Normal file
@ -0,0 +1,33 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/bootloader.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
OUTDIR="${COOKBOOK_BUILD}"
|
||||
mkdir -v "${COOKBOOK_STAGE}/boot"
|
||||
|
||||
function bootloader {
|
||||
export TARGET="$1"
|
||||
src="$2"
|
||||
dst="$3"
|
||||
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" -f "${COOKBOOK_SOURCE}/Makefile" -C "${OUTDIR}" "${OUTDIR}/${src}"
|
||||
cp -v "${OUTDIR}/${src}" "${COOKBOOK_STAGE}/boot/${dst}"
|
||||
}
|
||||
|
||||
ARCH="$(echo "${TARGET}" | cut -d - -f1)"
|
||||
|
||||
# Build BIOS bootloader for supported architectures
|
||||
if [ "${ARCH}" == "i586" -o "${ARCH}" == "i686" -o "${ARCH}" == "x86_64" ]
|
||||
then
|
||||
bootloader "x86-unknown-none" bootloader.bin bootloader.bios
|
||||
bootloader "x86-unknown-none" bootloader-live.bin bootloader-live.bios
|
||||
fi
|
||||
|
||||
# Build UEFI bootloader for supported architectures
|
||||
if [ "${ARCH}" == "aarch64" -o "${ARCH}" == "x86_64" -o "${ARCH}" == "riscv64gc" ]
|
||||
then
|
||||
bootloader "${ARCH}-unknown-uefi" bootloader.efi bootloader.efi
|
||||
bootloader "${ARCH}-unknown-uefi" bootloader-live.efi bootloader-live.efi
|
||||
fi
|
||||
"""
|
||||
5
recipes/core/contain/recipe.toml
Normal file
5
recipes/core/contain/recipe.toml
Normal file
@ -0,0 +1,5 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/contain.git"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
5
recipes/core/coreutils/recipe.toml
Normal file
5
recipes/core/coreutils/recipe.toml
Normal file
@ -0,0 +1,5 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/coreutils.git"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
22
recipes/core/dash/recipe.toml
Normal file
22
recipes/core/dash/recipe.toml
Normal file
@ -0,0 +1,22 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/dash.git"
|
||||
branch = "redox"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
|
||||
./autogen.sh
|
||||
./configure \
|
||||
--host="${TARGET}" \
|
||||
--prefix="" \
|
||||
--enable-static \
|
||||
cross_compiling=yes
|
||||
# See https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux.
|
||||
sed -i'' -e 's|#define HAVE_GETRLIMIT 1|/* #undef HAVE_GETRLIMIT */|g' config.h
|
||||
# Skip configure
|
||||
COOKBOOK_CONFIGURE="true"
|
||||
COOKBOOK_CONFIGURE_FLAGS=()
|
||||
cookbook_configure
|
||||
"""
|
||||
79
recipes/core/drivers-initfs/recipe.toml
Normal file
79
recipes/core/drivers-initfs/recipe.toml
Normal file
@ -0,0 +1,79 @@
|
||||
[source]
|
||||
same_as = "../drivers"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
BINS=(
|
||||
acpid
|
||||
fbbootlogd
|
||||
fbcond
|
||||
hwd
|
||||
inputd
|
||||
lived
|
||||
nvmed
|
||||
pcid
|
||||
pcid-spawner
|
||||
rtcd
|
||||
vesad
|
||||
)
|
||||
|
||||
virt_bins()
|
||||
{
|
||||
BINS+=(virtio-blkd virtio-gpud)
|
||||
}
|
||||
|
||||
x86_common_bins()
|
||||
{
|
||||
BINS+=(ahcid ided ps2d vesad)
|
||||
virt_bins
|
||||
}
|
||||
|
||||
aarch64_bins()
|
||||
{
|
||||
case "${BOARD}" in
|
||||
raspi3b*)
|
||||
BINS+=(bcm2835-sdhcid)
|
||||
;;
|
||||
*)
|
||||
#qemu-virt
|
||||
virt_bins
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "${TARGET}" in
|
||||
i586-unknown-redox | i686-unknown-redox)
|
||||
x86_common_bins
|
||||
;;
|
||||
x86_64-unknown-redox)
|
||||
x86_common_bins
|
||||
;;
|
||||
aarch64-unknown-redox)
|
||||
aarch64_bins
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
mkdir -pv "${COOKBOOK_STAGE}/bin" "${COOKBOOK_STAGE}/lib/drivers"
|
||||
export CARGO_PROFILE_RELEASE_OPT_LEVEL=s
|
||||
export CARGO_PROFILE_RELEASE_PANIC=abort
|
||||
"${COOKBOOK_CARGO}" build ${build_flags} \
|
||||
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
|
||||
$(for bin in "${BINS[@]}"; do echo "-p" "${bin}"; done)
|
||||
for bin in "${BINS[@]}"
|
||||
do
|
||||
case "${bin}" in
|
||||
pcid | pcid-spawner | fbbootlogd | fbcond | inputd | vesad | lived | ps2d | acpid | bcm2835-sdhcid | rtcd | hwd)
|
||||
cp -v "target/${TARGET}/${build_type}/${bin}" "${COOKBOOK_STAGE}/bin"
|
||||
;;
|
||||
*)
|
||||
cp -v "target/${TARGET}/${build_type}/${bin}" "${COOKBOOK_STAGE}/lib/drivers"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
mkdir -pv "${COOKBOOK_STAGE}/etc/pcid"
|
||||
cp -v "${COOKBOOK_SOURCE}/initfs.toml" "${COOKBOOK_STAGE}/etc/pcid/initfs.toml"
|
||||
"""
|
||||
61
recipes/core/drivers/recipe.toml
Normal file
61
recipes/core/drivers/recipe.toml
Normal file
@ -0,0 +1,61 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/drivers.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
# Drivers that are built on all architectures, and NOT in drivers-initfs
|
||||
BINS=(
|
||||
alxd
|
||||
e1000d
|
||||
ihdad
|
||||
ixgbed
|
||||
pcid
|
||||
pcid-spawner
|
||||
rtl8139d
|
||||
rtl8168d
|
||||
usbctl
|
||||
usbhidd
|
||||
usbhubd
|
||||
usbscsid
|
||||
virtio-netd
|
||||
xhcid
|
||||
inputd
|
||||
)
|
||||
|
||||
# Add additional drivers to the list to build, that are not in drivers-initfs
|
||||
# depending on the target architecture
|
||||
case "${TARGET}" in
|
||||
i586-unknown-redox | i686-unknown-redox | x86_64-unknown-redox)
|
||||
BINS+=(ac97d bgad sb16d vboxd)
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
#Build each driver in the list
|
||||
mkdir -pv "${COOKBOOK_STAGE}/usr/bin" "${COOKBOOK_STAGE}/usr/lib/drivers"
|
||||
export CARGO_PROFILE_RELEASE_OPT_LEVEL=s
|
||||
export CARGO_PROFILE_RELEASE_PANIC=abort
|
||||
"${COOKBOOK_CARGO}" build ${build_flags} \
|
||||
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
|
||||
$(for bin in "${BINS[@]}"; do echo "-p" "${bin}"; done)
|
||||
for bin in "${BINS[@]}"
|
||||
do
|
||||
if [[ "${bin}" == "inputd" || "${bin}" == "pcid" || "${bin}" == "pcid-spawner" ]]; then
|
||||
cp -v "target/${TARGET}/${build_type}/${bin}" "${COOKBOOK_STAGE}/usr/bin"
|
||||
else
|
||||
cp -v "target/${TARGET}/${build_type}/${bin}" "${COOKBOOK_STAGE}/usr/lib/drivers"
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -pv "${COOKBOOK_STAGE}/etc/pcid"
|
||||
cp -v "${COOKBOOK_SOURCE}/initfs.toml" "${COOKBOOK_STAGE}/etc/pcid/initfs.toml"
|
||||
|
||||
mkdir -pv "${COOKBOOK_STAGE}/etc/pcid.d"
|
||||
${FIND} "${COOKBOOK_SOURCE}" -maxdepth 3 -type f -name 'config.toml' | while read conf
|
||||
do
|
||||
driver="$(basename "$(dirname "$conf")")"
|
||||
cp -v "$conf" "${COOKBOOK_STAGE}/etc/pcid.d/$driver.toml"
|
||||
done
|
||||
"""
|
||||
18
recipes/core/extrautils/recipe.toml
Normal file
18
recipes/core/extrautils/recipe.toml
Normal file
@ -0,0 +1,18 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/extrautils.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"xz"
|
||||
]
|
||||
script = """
|
||||
# TODO: Can't be linked correctly yet
|
||||
# DYNAMIC_INIT
|
||||
|
||||
if [ "${COOKBOOK_DYNAMIC}" != "1" ]; then
|
||||
install_flags+=" --features=static"
|
||||
fi
|
||||
|
||||
cookbook_cargo
|
||||
"""
|
||||
9
recipes/core/findutils/recipe.toml
Normal file
9
recipes/core/findutils/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/findutils.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
cookbook_cargo --bin find
|
||||
"""
|
||||
5
recipes/core/installer/recipe.toml
Normal file
5
recipes/core/installer/recipe.toml
Normal file
@ -0,0 +1,5 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/installer.git"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
9
recipes/core/ion/recipe.toml
Normal file
9
recipes/core/ion/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/ion.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
# Must be statically linked
|
||||
cookbook_cargo
|
||||
"""
|
||||
10
recipes/core/kernel/recipe.toml
Normal file
10
recipes/core/kernel/recipe.toml
Normal file
@ -0,0 +1,10 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/kernel.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
make -f ${COOKBOOK_SOURCE}/Makefile
|
||||
mkdir -v "${COOKBOOK_STAGE}/boot"
|
||||
cp -v kernel "${COOKBOOK_STAGE}/boot"
|
||||
"""
|
||||
8
recipes/core/netdb/recipe.toml
Normal file
8
recipes/core/netdb/recipe.toml
Normal file
@ -0,0 +1,8 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/netdb.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
cp -rv "${COOKBOOK_SOURCE}/"* "${COOKBOOK_STAGE}"
|
||||
"""
|
||||
5
recipes/core/netutils/recipe.toml
Normal file
5
recipes/core/netutils/recipe.toml
Normal file
@ -0,0 +1,5 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/netutils.git"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
6
recipes/core/pkgar/recipe.toml
Normal file
6
recipes/core/pkgar/recipe.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/pkgar.git"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
package_path = "pkgar"
|
||||
10
recipes/core/pkgutils/recipe.toml
Normal file
10
recipes/core/pkgutils/recipe.toml
Normal file
@ -0,0 +1,10 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/pkgutils.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
# Must be statically linked
|
||||
PACKAGE_PATH=pkg-cli
|
||||
cookbook_cargo
|
||||
"""
|
||||
9
recipes/core/profiled/recipe.toml
Normal file
9
recipes/core/profiled/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/profiled.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
# Must be statically linked
|
||||
cookbook_cargo
|
||||
"""
|
||||
9
recipes/core/redoxerd/recipe.toml
Normal file
9
recipes/core/redoxerd/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/redoxer.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
COOKBOOK_SOURCE="${COOKBOOK_SOURCE}/daemon"
|
||||
cookbook_cargo
|
||||
"""
|
||||
9
recipes/core/redoxfs/recipe.toml
Normal file
9
recipes/core/redoxfs/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/redoxfs.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
# Must be statically linked
|
||||
cookbook_cargo
|
||||
"""
|
||||
13
recipes/core/relibc/recipe.toml
Normal file
13
recipes/core/relibc/recipe.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/relibc.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
"${COOKBOOK_MAKE}" \
|
||||
-C "${COOKBOOK_SOURCE}" \
|
||||
-j"$($NPROC)" \
|
||||
CARGO="env -u CARGO cargo" \
|
||||
DESTDIR="${COOKBOOK_STAGE}" \
|
||||
install
|
||||
"""
|
||||
5
recipes/core/strace/recipe.toml
Normal file
5
recipes/core/strace/recipe.toml
Normal file
@ -0,0 +1,5 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/strace-redox.git"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
11
recipes/core/userutils/recipe.toml
Normal file
11
recipes/core/userutils/recipe.toml
Normal file
@ -0,0 +1,11 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/userutils.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
cookbook_cargo
|
||||
cp -rv "${COOKBOOK_SOURCE}/res" "${COOKBOOK_STAGE}/etc"
|
||||
ln -s id "${COOKBOOK_STAGE}/usr/bin/whoami"
|
||||
"""
|
||||
107
recipes/core/uutils/recipe.toml
Normal file
107
recipes/core/uutils/recipe.toml
Normal file
@ -0,0 +1,107 @@
|
||||
# TODO Fix coreutils i18n/l10n behavior on Redox
|
||||
[source]
|
||||
git = "https://github.com/uutils/coreutils"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
cookbook_cargo --no-default-features --features feat_os_unix_redox --bin coreutils
|
||||
|
||||
BINS=(
|
||||
'['
|
||||
b2sum
|
||||
b3sum
|
||||
base32
|
||||
base64
|
||||
basename
|
||||
basenc
|
||||
cat
|
||||
chmod
|
||||
cksum
|
||||
comm
|
||||
cp
|
||||
csplit
|
||||
cut
|
||||
date
|
||||
dd
|
||||
#df not working, use redox coreutils
|
||||
dir
|
||||
dircolors
|
||||
dirname
|
||||
du
|
||||
echo
|
||||
env
|
||||
expand
|
||||
expr
|
||||
factor
|
||||
false
|
||||
fmt
|
||||
fold
|
||||
hashsum
|
||||
head
|
||||
join
|
||||
install
|
||||
link
|
||||
ln
|
||||
ls
|
||||
md5sum
|
||||
mkdir
|
||||
mktemp
|
||||
more
|
||||
mv
|
||||
nl
|
||||
numfmt
|
||||
od
|
||||
paste
|
||||
pr
|
||||
printenv
|
||||
printf
|
||||
ptx
|
||||
pwd
|
||||
readlink
|
||||
realpath
|
||||
rm
|
||||
rmdir
|
||||
seq
|
||||
sha1sum
|
||||
sha224sum
|
||||
sha256sum
|
||||
sha3-224sum
|
||||
sha3-256sum
|
||||
sha3-384sum
|
||||
sha3-512sum
|
||||
sha384sum
|
||||
sha3sum
|
||||
sha512sum
|
||||
shake128sum
|
||||
shake256sum
|
||||
shred
|
||||
shuf
|
||||
sleep
|
||||
sort
|
||||
split
|
||||
stat
|
||||
sum
|
||||
tac
|
||||
tail
|
||||
tee
|
||||
test
|
||||
touch
|
||||
tr
|
||||
true
|
||||
truncate
|
||||
tsort
|
||||
unexpand
|
||||
uniq
|
||||
unlink
|
||||
vdir
|
||||
wc
|
||||
yes
|
||||
)
|
||||
|
||||
for bin in "${BINS[@]}"
|
||||
do
|
||||
ln -sv coreutils "${COOKBOOK_STAGE}/usr/bin/$bin"
|
||||
done
|
||||
"""
|
||||
129
recipes/demos/cairodemo/cairodemo.c
Executable file
129
recipes/demos/cairodemo/cairodemo.c
Executable file
@ -0,0 +1,129 @@
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <cairo/cairo.h>
|
||||
#include <orbital.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265
|
||||
#endif
|
||||
|
||||
static int width = 800;
|
||||
static int height = 600;
|
||||
|
||||
static void
|
||||
travel_path (cairo_t *cr)
|
||||
{
|
||||
|
||||
cairo_pattern_t *pat;
|
||||
|
||||
pat = cairo_pattern_create_linear (0.0, 0.0, 0.0, 256.0);
|
||||
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1);
|
||||
cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 1);
|
||||
cairo_rectangle (cr, 0, 0, 256, 256);
|
||||
cairo_set_source (cr, pat);
|
||||
cairo_fill (cr);
|
||||
cairo_pattern_destroy (pat);
|
||||
|
||||
pat = cairo_pattern_create_radial (115.2, 102.4, 25.6,
|
||||
102.4, 102.4, 128.0);
|
||||
cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 1);
|
||||
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1);
|
||||
cairo_set_source (cr, pat);
|
||||
cairo_arc (cr, 128.0, 128.0, 76.8, 0, 2 * M_PI);
|
||||
cairo_fill (cr);
|
||||
cairo_pattern_destroy (pat);
|
||||
|
||||
|
||||
double x = 305.6, /* parameters like cairo_rectangle */
|
||||
y = 25.6,
|
||||
width = 204.8,
|
||||
height = 204.8,
|
||||
aspect = 1.0, /* aspect ratio */
|
||||
corner_radius = height / 10.0; /* and corner curvature radius */
|
||||
|
||||
double radius = corner_radius / aspect;
|
||||
double degrees = M_PI / 180.0;
|
||||
|
||||
cairo_new_sub_path (cr);
|
||||
cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees);
|
||||
cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees);
|
||||
cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees);
|
||||
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees);
|
||||
cairo_close_path (cr);
|
||||
|
||||
cairo_set_source_rgb (cr, 0.5, 0.5, 1);
|
||||
cairo_fill_preserve (cr);
|
||||
cairo_set_source_rgba (cr, 0.5, 0, 0, 0.5);
|
||||
cairo_set_line_width (cr, 10.0);
|
||||
cairo_stroke (cr);
|
||||
|
||||
|
||||
double xc = 128.0;
|
||||
double yc = 128.0;
|
||||
radius = 100.0;
|
||||
double angle1 = 45.0 * (M_PI/180.0); /* angles are specified */
|
||||
double angle2 = 180.0 * (M_PI/180.0); /* in radians */
|
||||
|
||||
cairo_set_line_width (cr, 10.0);
|
||||
cairo_arc (cr, xc, yc, radius, angle1, angle2);
|
||||
cairo_stroke (cr);
|
||||
|
||||
/* draw helping lines */
|
||||
cairo_set_source_rgba (cr, 1, 0.2, 0.2, 0.6);
|
||||
cairo_set_line_width (cr, 6.0);
|
||||
|
||||
cairo_arc (cr, xc, yc, 10.0, 0, 2*M_PI);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_arc (cr, xc, yc, radius, angle1, angle1);
|
||||
cairo_line_to (cr, xc, yc);
|
||||
cairo_arc (cr, xc, yc, radius, angle2, angle2);
|
||||
cairo_line_to (cr, xc, yc);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
static void
|
||||
draw (cairo_surface_t *surface)
|
||||
{
|
||||
cairo_t *cr;
|
||||
cr = cairo_create (surface);
|
||||
travel_path (cr);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
void * window = orb_window_new(-1, -1, width, height, "CairoDemo");
|
||||
|
||||
//Cairo
|
||||
uint32_t * frame_data = orb_window_data(window);
|
||||
cairo_surface_t *surface = cairo_image_surface_create_for_data((uint8_t*) frame_data, CAIRO_FORMAT_ARGB32, width, height, cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width));
|
||||
cairo_create(surface);
|
||||
draw (surface);
|
||||
|
||||
orb_window_sync(window);
|
||||
|
||||
char running = 1;
|
||||
while (running) {
|
||||
void * event_iter = orb_window_events(window);
|
||||
|
||||
OrbEventOption event_option;
|
||||
do {
|
||||
event_option = orb_events_next(event_iter);
|
||||
switch (event_option.tag) {
|
||||
case OrbEventOption_Quit:
|
||||
running = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (running && event_option.tag != OrbEventOption_None);
|
||||
|
||||
orb_events_destroy(event_iter);
|
||||
}
|
||||
orb_window_destroy(window);
|
||||
return 0; /* ANSI C requires main to return int. */
|
||||
}
|
||||
|
||||
25
recipes/demos/cairodemo/recipe.toml
Executable file
25
recipes/demos/cairodemo/recipe.toml
Executable file
@ -0,0 +1,25 @@
|
||||
# source is part of cookbook
|
||||
|
||||
[build]
|
||||
dependencies = [
|
||||
"cairo",
|
||||
"expat",
|
||||
"fontconfig",
|
||||
"freetype2",
|
||||
"liborbital",
|
||||
"libpng",
|
||||
"pixman",
|
||||
"zlib",
|
||||
]
|
||||
template = "custom"
|
||||
script = """
|
||||
"${CXX}" \
|
||||
$("${PKG_CONFIG}" --cflags cairo) \
|
||||
"${COOKBOOK_RECIPE}/cairodemo.c" \
|
||||
-o cairodemo \
|
||||
-static \
|
||||
$("${PKG_CONFIG}" --libs cairo) \
|
||||
-lorbital
|
||||
mkdir -pv "${COOKBOOK_STAGE}/bin"
|
||||
cp -v "cairodemo" "${COOKBOOK_STAGE}/bin/cairodemo"
|
||||
"""
|
||||
30
recipes/demos/cmatrix/recipe.toml
Normal file
30
recipes/demos/cmatrix/recipe.toml
Normal file
@ -0,0 +1,30 @@
|
||||
[source]
|
||||
git = "https://github.com/abishekvashok/cmatrix"
|
||||
script = """
|
||||
autoreconf -i
|
||||
"""
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"ncursesw"
|
||||
]
|
||||
script = """
|
||||
export LIBS="-lncursesw"
|
||||
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--without-fonts
|
||||
)
|
||||
|
||||
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
|
||||
|
||||
sed -i -e 's|#define USE_TIOCSTI 1|/* #undef USE_TIOCSTI */|g' config.h
|
||||
|
||||
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}"
|
||||
"${COOKBOOK_MAKE}" install DESTDIR="${COOKBOOK_STAGE}"
|
||||
"""
|
||||
|
||||
[package]
|
||||
dependencies = [
|
||||
"terminfo"
|
||||
]
|
||||
10
recipes/demos/cpal/recipe.toml
Normal file
10
recipes/demos/cpal/recipe.toml
Normal file
@ -0,0 +1,10 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/cpal.git"
|
||||
branch = "redox"
|
||||
upstream = "https://github.com/tomaka/cpal.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
cookbook_cargo_examples beep
|
||||
"""
|
||||
9
recipes/demos/dynamic-example/recipe.toml
Normal file
9
recipes/demos/dynamic-example/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/dynamic-example.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
cookbook_cargo
|
||||
"""
|
||||
5
recipes/demos/exampled/recipe.toml
Normal file
5
recipes/demos/exampled/recipe.toml
Normal file
@ -0,0 +1,5 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/exampled.git"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
344
recipes/demos/gears/gears.c
Normal file
344
recipes/demos/gears/gears.c
Normal file
@ -0,0 +1,344 @@
|
||||
/* gears.c */
|
||||
|
||||
/*
|
||||
* 3-D gear wheels. This program is in the public domain.
|
||||
*
|
||||
* Brian Paul
|
||||
*/
|
||||
|
||||
/* Conversion to GLUT by Mark J. Kilgard */
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#include <GL/osmesa.h>
|
||||
#include <orbital.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Draw a gear wheel. You'll probably want to call this function when
|
||||
building a display list since we do a lot of trig here.
|
||||
|
||||
Input: inner_radius - radius of hole at center
|
||||
outer_radius - radius at center of teeth
|
||||
width - width of gear
|
||||
teeth - number of teeth
|
||||
tooth_depth - depth of tooth
|
||||
|
||||
**/
|
||||
|
||||
static void
|
||||
gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
|
||||
GLint teeth, GLfloat tooth_depth)
|
||||
{
|
||||
GLint i;
|
||||
GLfloat r0, r1, r2;
|
||||
GLfloat angle, da;
|
||||
GLfloat u, v, len;
|
||||
|
||||
r0 = inner_radius;
|
||||
r1 = outer_radius - tooth_depth / 2.0;
|
||||
r2 = outer_radius + tooth_depth / 2.0;
|
||||
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
glNormal3f(0.0, 0.0, 1.0);
|
||||
|
||||
/* draw front face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw front sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
glNormal3f(0.0, 0.0, -1.0);
|
||||
|
||||
/* draw back face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw back sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw outward faces of teeth */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
u = r2 * cos(angle + da) - r1 * cos(angle);
|
||||
v = r2 * sin(angle + da) - r1 * sin(angle);
|
||||
len = sqrt(u * u + v * v);
|
||||
u /= len;
|
||||
v /= len;
|
||||
glNormal3f(v, -u, 0.0);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
|
||||
glNormal3f(cos(angle), sin(angle), 0.0);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
|
||||
u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
|
||||
v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
|
||||
glNormal3f(v, -u, 0.0);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
|
||||
glNormal3f(cos(angle), sin(angle), 0.0);
|
||||
}
|
||||
|
||||
glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
|
||||
glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
|
||||
|
||||
glEnd();
|
||||
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
/* draw inside radius cylinder */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glNormal3f(-cos(angle), -sin(angle), 0.0);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
}
|
||||
|
||||
static int width = 800;
|
||||
static int height = 600;
|
||||
|
||||
static void * buffer = NULL;
|
||||
static void * window = NULL;
|
||||
|
||||
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
|
||||
static GLint gear1, gear2, gear3;
|
||||
static GLfloat angle = 0.0;
|
||||
|
||||
static GLuint limit;
|
||||
static GLuint count = 1;
|
||||
|
||||
static void
|
||||
sync(void)
|
||||
{
|
||||
glFinish();
|
||||
|
||||
uint32_t * frame_data = orb_window_data(window);
|
||||
uint32_t * image_data = (uint32_t *)buffer;
|
||||
|
||||
int i;
|
||||
for(i = 0; i < width * height; i++) {
|
||||
frame_data[i] = image_data[i] | 0xFF000000;
|
||||
}
|
||||
|
||||
orb_window_sync(window);
|
||||
}
|
||||
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(view_rotx, 1.0, 0.0, 0.0);
|
||||
glRotatef(view_roty, 0.0, 1.0, 0.0);
|
||||
glRotatef(view_rotz, 0.0, 0.0, 1.0);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.0, -2.0, 0.0);
|
||||
glRotatef(angle, 0.0, 0.0, 1.0);
|
||||
glCallList(gear1);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(3.1, -2.0, 0.0);
|
||||
glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
|
||||
glCallList(gear2);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.1, 4.2, 0.0);
|
||||
glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
|
||||
glCallList(gear3);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
sync();
|
||||
|
||||
count++;
|
||||
if (count == limit) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
idle(void)
|
||||
{
|
||||
angle += 2.0;
|
||||
draw();
|
||||
}
|
||||
|
||||
/* new window size or exposure */
|
||||
static void
|
||||
reshape(int width, int height)
|
||||
{
|
||||
GLfloat h = (GLfloat) height / (GLfloat) width;
|
||||
|
||||
glViewport(0, 0, (GLint) width, (GLint) height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
}
|
||||
|
||||
static void
|
||||
init(void)
|
||||
{
|
||||
static GLfloat pos[4] =
|
||||
{5.0, 5.0, 10.0, 0.0};
|
||||
static GLfloat red[4] =
|
||||
{0.8, 0.1, 0.0, 1.0};
|
||||
static GLfloat green[4] =
|
||||
{0.0, 0.8, 0.2, 1.0};
|
||||
static GLfloat blue[4] =
|
||||
{0.2, 0.2, 1.0, 1.0};
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, pos);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
/* make the gears */
|
||||
gear1 = glGenLists(1);
|
||||
glNewList(gear1, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
|
||||
gear(1.0, 4.0, 1.0, 20, 0.7);
|
||||
glEndList();
|
||||
|
||||
gear2 = glGenLists(1);
|
||||
glNewList(gear2, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
|
||||
gear(0.5, 2.0, 2.0, 10, 0.7);
|
||||
glEndList();
|
||||
|
||||
gear3 = glGenLists(1);
|
||||
glNewList(gear3, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
|
||||
gear(1.3, 2.0, 0.5, 10, 0.7);
|
||||
glEndList();
|
||||
|
||||
glEnable(GL_NORMALIZE);
|
||||
}
|
||||
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
if (argc > 1) {
|
||||
/* do 'n' frames then exit */
|
||||
limit = atoi(argv[1]) + 1;
|
||||
} else {
|
||||
limit = 0;
|
||||
}
|
||||
|
||||
OSMesaContext ctx = OSMesaCreateContextExt(OSMESA_BGRA, 16, 0, 0, NULL);
|
||||
if (!ctx) {
|
||||
printf("OSMesaCreateContextExt failed\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
buffer = malloc(width * height * 4);
|
||||
if(!buffer) {
|
||||
printf("malloc failed\n");
|
||||
OSMesaDestroyContext(ctx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!OSMesaMakeCurrent(ctx, buffer, GL_UNSIGNED_BYTE, width, height)) {
|
||||
printf("OSMesaMakeCurrent failed\n");
|
||||
OSMesaDestroyContext(ctx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
OSMesaPixelStore(OSMESA_Y_UP, 0);
|
||||
|
||||
OSMesaColorClamp(GL_TRUE);
|
||||
|
||||
window = orb_window_new_flags(-1, -1, width, height, "Gears", ORB_WINDOW_ASYNC);
|
||||
|
||||
init();
|
||||
|
||||
reshape(width, height);
|
||||
|
||||
char running = 1;
|
||||
while (running) {
|
||||
idle();
|
||||
|
||||
void * event_iter = orb_window_events(window);
|
||||
|
||||
OrbEventOption event_option;
|
||||
do {
|
||||
event_option = orb_events_next(event_iter);
|
||||
switch (event_option.tag) {
|
||||
case OrbEventOption_Quit:
|
||||
running = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (running && event_option.tag != OrbEventOption_None);
|
||||
|
||||
orb_events_destroy(event_iter);
|
||||
}
|
||||
|
||||
orb_window_destroy(window);
|
||||
OSMesaDestroyContext(ctx);
|
||||
free(buffer);
|
||||
|
||||
return 0; /* ANSI C requires main to return int. */
|
||||
}
|
||||
18
recipes/demos/gears/recipe.toml
Normal file
18
recipes/demos/gears/recipe.toml
Normal file
@ -0,0 +1,18 @@
|
||||
[build]
|
||||
dependencies=[
|
||||
"liborbital",
|
||||
"llvm18",
|
||||
"mesa",
|
||||
"mesa-glu",
|
||||
"zlib",
|
||||
]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
${CXX} -O2 -I "${COOKBOOK_SYSROOT}/usr/include" \
|
||||
$LDFLAGS "${COOKBOOK_RECIPE}/gears.c" \
|
||||
-o gears -lorbital $("${PKG_CONFIG}" --libs glu) -lz
|
||||
mkdir -pv "${COOKBOOK_STAGE}/usr/bin"
|
||||
cp -v "gears" "${COOKBOOK_STAGE}/usr/bin/gears"
|
||||
"""
|
||||
29
recipes/demos/glutin/recipe.toml
Normal file
29
recipes/demos/glutin/recipe.toml
Normal file
@ -0,0 +1,29 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/glutin.git"
|
||||
branch = "redox-0.30"
|
||||
upstream = "https://github.com/rust-windowing/glutin.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"llvm18",
|
||||
"mesa",
|
||||
"zlib"
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
EXAMPLES=(
|
||||
window
|
||||
)
|
||||
for example in "${EXAMPLES[@]}"
|
||||
do
|
||||
cargo rustc \
|
||||
--target "$TARGET" \
|
||||
--release \
|
||||
--manifest-path "${COOKBOOK_SOURCE}/glutin_examples/Cargo.toml" \
|
||||
--example "${example}" \
|
||||
-- -C link-args="$LDFLAGS $("${TARGET}-pkg-config" --libs osmesa) -lz -lstdc++ -lc -lgcc"
|
||||
mkdir -pv "${COOKBOOK_STAGE}/bin"
|
||||
cp -v "target/${TARGET}/release/examples/${example}" "${COOKBOOK_STAGE}/bin/glutin_${example}"
|
||||
done
|
||||
"""
|
||||
9
recipes/demos/iced/recipe.toml
Normal file
9
recipes/demos/iced/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/iced.git"
|
||||
branch = "redox"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
cookbook_cargo_packages styling
|
||||
"""
|
||||
8
recipes/demos/orbclient/recipe.toml
Normal file
8
recipes/demos/orbclient/recipe.toml
Normal file
@ -0,0 +1,8 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/orbclient.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
cookbook_cargo_examples simple
|
||||
"""
|
||||
547
recipes/demos/osdemo/osdemo.c
Normal file
547
recipes/demos/osdemo/osdemo.c
Normal file
@ -0,0 +1,547 @@
|
||||
/*
|
||||
* Test OSMesa interface at 8, 16 and 32 bits/channel.
|
||||
*
|
||||
* Usage: osdemo [options]
|
||||
*
|
||||
* Options:
|
||||
* -f generate image files
|
||||
* -g render gradient and print color values
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <GL/osmesa.h>
|
||||
#include <GL/glu.h>
|
||||
#include <orbital.h>
|
||||
|
||||
#define WIDTH 600
|
||||
#define HEIGHT 600
|
||||
|
||||
static GLboolean DisplayImages = GL_FALSE;
|
||||
static GLboolean WriteFiles = GL_FALSE;
|
||||
static GLboolean Gradient = GL_FALSE;
|
||||
|
||||
|
||||
static void
|
||||
Sphere(float radius, int slices, int stacks)
|
||||
{
|
||||
GLUquadric *q = gluNewQuadric();
|
||||
gluQuadricNormals(q, GLU_SMOOTH);
|
||||
gluSphere(q, radius, slices, stacks);
|
||||
gluDeleteQuadric(q);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Cone(float base, float height, int slices, int stacks)
|
||||
{
|
||||
GLUquadric *q = gluNewQuadric();
|
||||
gluQuadricDrawStyle(q, GLU_FILL);
|
||||
gluQuadricNormals(q, GLU_SMOOTH);
|
||||
gluCylinder(q, base, 0.0, height, slices, stacks);
|
||||
gluDeleteQuadric(q);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Torus(float innerRadius, float outerRadius, int sides, int rings)
|
||||
{
|
||||
/* from GLUT... */
|
||||
int i, j;
|
||||
GLfloat theta, phi, theta1;
|
||||
GLfloat cosTheta, sinTheta;
|
||||
GLfloat cosTheta1, sinTheta1;
|
||||
const GLfloat ringDelta = 2.0 * M_PI / rings;
|
||||
const GLfloat sideDelta = 2.0 * M_PI / sides;
|
||||
|
||||
theta = 0.0;
|
||||
cosTheta = 1.0;
|
||||
sinTheta = 0.0;
|
||||
for (i = rings - 1; i >= 0; i--) {
|
||||
theta1 = theta + ringDelta;
|
||||
cosTheta1 = cos(theta1);
|
||||
sinTheta1 = sin(theta1);
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
phi = 0.0;
|
||||
for (j = sides; j >= 0; j--) {
|
||||
GLfloat cosPhi, sinPhi, dist;
|
||||
|
||||
phi += sideDelta;
|
||||
cosPhi = cos(phi);
|
||||
sinPhi = sin(phi);
|
||||
dist = outerRadius + innerRadius * cosPhi;
|
||||
|
||||
glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
|
||||
glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, innerRadius * sinPhi);
|
||||
glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
|
||||
glVertex3f(cosTheta * dist, -sinTheta * dist, innerRadius * sinPhi);
|
||||
}
|
||||
glEnd();
|
||||
theta = theta1;
|
||||
cosTheta = cosTheta1;
|
||||
sinTheta = sinTheta1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void Cube(float size)
|
||||
{
|
||||
size = 0.5 * size;
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
/* +X face */
|
||||
glNormal3f(1, 0, 0);
|
||||
glVertex3f(size, -size, size);
|
||||
glVertex3f(size, -size, -size);
|
||||
glVertex3f(size, size, -size);
|
||||
glVertex3f(size, size, size);
|
||||
|
||||
/* -X face */
|
||||
glNormal3f(-1, 0, 0);
|
||||
glVertex3f(-size, size, size);
|
||||
glVertex3f(-size, size, -size);
|
||||
glVertex3f(-size, -size, -size);
|
||||
glVertex3f(-size, -size, size);
|
||||
|
||||
/* +Y face */
|
||||
glNormal3f(0, 1, 0);
|
||||
glVertex3f(-size, size, size);
|
||||
glVertex3f( size, size, size);
|
||||
glVertex3f( size, size, -size);
|
||||
glVertex3f(-size, size, -size);
|
||||
|
||||
/* -Y face */
|
||||
glNormal3f(0, -1, 0);
|
||||
glVertex3f(-size, -size, -size);
|
||||
glVertex3f( size, -size, -size);
|
||||
glVertex3f( size, -size, size);
|
||||
glVertex3f(-size, -size, size);
|
||||
|
||||
/* +Z face */
|
||||
glNormal3f(0, 0, 1);
|
||||
glVertex3f(-size, -size, size);
|
||||
glVertex3f( size, -size, size);
|
||||
glVertex3f( size, size, size);
|
||||
glVertex3f(-size, size, size);
|
||||
|
||||
/* -Z face */
|
||||
glNormal3f(0, 0, -1);
|
||||
glVertex3f(-size, size, -size);
|
||||
glVertex3f( size, size, -size);
|
||||
glVertex3f( size, -size, -size);
|
||||
glVertex3f(-size, -size, -size);
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Draw red/green gradient across bottom of image.
|
||||
* Read pixels to check deltas.
|
||||
*/
|
||||
static void
|
||||
render_gradient(void)
|
||||
{
|
||||
GLfloat row[WIDTH][4];
|
||||
int i;
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1, 1, -1, 1, -1, 1);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(1, 0, 0);
|
||||
glVertex2f(-1, -1.0);
|
||||
glVertex2f(-1, -0.9);
|
||||
glColor3f(0, 1, 0);
|
||||
glVertex2f(1, -0.9);
|
||||
glVertex2f(1, -1.0);
|
||||
glEnd();
|
||||
glFinish();
|
||||
|
||||
glReadPixels(0, 0, WIDTH, 1, GL_RGBA, GL_FLOAT, row);
|
||||
for (i = 0; i < 4; i++) {
|
||||
printf("row[i] = %f, %f, %f\n", row[i][0], row[i][1], row[i][2]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
render_image(void)
|
||||
{
|
||||
static const GLfloat light_ambient[4] = { 0.0, 0.0, 0.0, 1.0 };
|
||||
static const GLfloat light_diffuse[4] = { 1.0, 1.0, 1.0, 1.0 };
|
||||
static const GLfloat light_specular[4] = { 1.0, 1.0, 1.0, 1.0 };
|
||||
static const GLfloat light_position[4] = { 1.0, 1.0, 1.0, 0.0 };
|
||||
static const GLfloat red_mat[4] = { 1.0, 0.2, 0.2, 1.0 };
|
||||
static const GLfloat green_mat[4] = { 0.2, 1.0, 0.2, 1.0 };
|
||||
static const GLfloat blue_mat[4] = { 0.2, 0.2, 1.0, 1.0 };
|
||||
#if 0
|
||||
static const GLfloat yellow_mat[4] = { 0.8, 0.8, 0.0, 1.0 };
|
||||
#endif
|
||||
static const GLfloat purple_mat[4] = { 0.8, 0.4, 0.8, 0.6 };
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
|
||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
|
||||
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_LIGHT0);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -1.0, 1.0, 2.0, 50.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glTranslatef(0, 0.5, -7);
|
||||
|
||||
glClearColor(0.3, 0.3, 0.7, 0.0);
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(20.0, 1.0, 0.0, 0.0);
|
||||
|
||||
/* ground */
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBegin(GL_POLYGON);
|
||||
glNormal3f(0, 1, 0);
|
||||
glTexCoord2f(0, 0); glVertex3f(-5, -1, -5);
|
||||
glTexCoord2f(1, 0); glVertex3f( 5, -1, -5);
|
||||
glTexCoord2f(1, 1); glVertex3f( 5, -1, 5);
|
||||
glTexCoord2f(0, 1); glVertex3f(-5, -1, 5);
|
||||
glEnd();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-1.5, 0.5, 0.0);
|
||||
glRotatef(90.0, 1.0, 0.0, 0.0);
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red_mat );
|
||||
Torus(0.275, 0.85, 20, 20);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-1.5, -0.5, 0.0);
|
||||
glRotatef(270.0, 1.0, 0.0, 0.0);
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, green_mat );
|
||||
Cone(1.0, 2.0, 16, 1);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(0.95, 0.0, -0.8);
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
|
||||
glLineWidth(2.0);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
Sphere(1.2, 20, 20);
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
glPopMatrix();
|
||||
|
||||
#if 0
|
||||
glPushMatrix();
|
||||
glTranslatef(0.75, 0.0, 1.3);
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, yellow_mat );
|
||||
glutWireTeapot(1.0);
|
||||
glPopMatrix();
|
||||
#endif
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-0.25, 0.0, 2.5);
|
||||
glRotatef(40, 0, 1, 0);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_BLEND);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, purple_mat );
|
||||
Cube(1.0);
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glPopMatrix();
|
||||
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
init_context(void)
|
||||
{
|
||||
const GLint texWidth = 64, texHeight = 64;
|
||||
GLubyte *texImage;
|
||||
int i, j;
|
||||
|
||||
/* checker image */
|
||||
texImage = (GLubyte *)malloc(texWidth * texHeight * 4);
|
||||
for (i = 0; i < texHeight; i++) {
|
||||
for (j = 0; j < texWidth; j++) {
|
||||
int k = (i * texWidth + j) * 4;
|
||||
if ((i % 5) == 0 || (j % 5) == 0) {
|
||||
texImage[k+0] = 200;
|
||||
texImage[k+1] = 200;
|
||||
texImage[k+2] = 200;
|
||||
texImage[k+3] = 255;
|
||||
}
|
||||
else {
|
||||
if ((i % 5) == 1 || (j % 5) == 1) {
|
||||
texImage[k+0] = 50;
|
||||
texImage[k+1] = 50;
|
||||
texImage[k+2] = 50;
|
||||
texImage[k+3] = 255;
|
||||
}
|
||||
else {
|
||||
texImage[k+0] = 100;
|
||||
texImage[k+1] = 100;
|
||||
texImage[k+2] = 100;
|
||||
texImage[k+3] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texWidth, texHeight, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, texImage);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
free(texImage);
|
||||
}
|
||||
|
||||
static void
|
||||
display_image(const char *filename, const GLubyte *buffer, int width, int height)
|
||||
{
|
||||
void * window = orb_window_new(-1, -1, width, height, filename);
|
||||
|
||||
uint32_t * frame_data = orb_window_data(window);
|
||||
uint32_t * image_data = (uint32_t *)buffer;
|
||||
|
||||
int x, y;
|
||||
for(y = 0; y < height; y++) {
|
||||
for(x = 0; x < width; x++) {
|
||||
frame_data[y * width + x] = image_data[(height - 1 - y) * width + x] | 0xFF000000;
|
||||
}
|
||||
}
|
||||
|
||||
orb_window_sync(window);
|
||||
|
||||
char running = 1;
|
||||
while (running) {
|
||||
void * event_iter = orb_window_events(window);
|
||||
|
||||
OrbEventOption event_option;
|
||||
do {
|
||||
event_option = orb_events_next(event_iter);
|
||||
switch (event_option.tag) {
|
||||
case OrbEventOption_Quit:
|
||||
running = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (running && event_option.tag != OrbEventOption_None);
|
||||
|
||||
orb_events_destroy(event_iter);
|
||||
}
|
||||
|
||||
orb_window_destroy(window);
|
||||
}
|
||||
|
||||
static void
|
||||
write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
|
||||
{
|
||||
const int binary = 0;
|
||||
FILE *f = fopen( filename, "w" );
|
||||
if (f) {
|
||||
int i, x, y;
|
||||
const GLubyte *ptr = buffer;
|
||||
if (binary) {
|
||||
fprintf(f,"P6\n");
|
||||
fprintf(f,"# ppm-file created by osdemo.c\n");
|
||||
fprintf(f,"%i %i\n", width,height);
|
||||
fprintf(f,"255\n");
|
||||
fclose(f);
|
||||
f = fopen( filename, "ab" ); /* reopen in binary append mode */
|
||||
for (y=height-1; y>=0; y--) {
|
||||
for (x=0; x<width; x++) {
|
||||
i = (y*width + x) * 4;
|
||||
fputc(ptr[i], f); /* write red */
|
||||
fputc(ptr[i+1], f); /* write green */
|
||||
fputc(ptr[i+2], f); /* write blue */
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*ASCII*/
|
||||
int counter = 0;
|
||||
fprintf(f,"P3\n");
|
||||
fprintf(f,"# ascii ppm file created by osdemo.c\n");
|
||||
fprintf(f,"%i %i\n", width, height);
|
||||
fprintf(f,"255\n");
|
||||
for (y=height-1; y>=0; y--) {
|
||||
for (x=0; x<width; x++) {
|
||||
i = (y*width + x) * 4;
|
||||
fprintf(f, " %3d %3d %3d", ptr[i], ptr[i+1], ptr[i+2]);
|
||||
counter++;
|
||||
if (counter % 5 == 0)
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static GLboolean
|
||||
test(GLenum type, GLint bits, const char *filename)
|
||||
{
|
||||
const GLint z = 16, stencil = 0, accum = 0;
|
||||
OSMesaContext ctx;
|
||||
void *buffer;
|
||||
GLint cBits;
|
||||
|
||||
assert(bits == 8 ||
|
||||
bits == 16 ||
|
||||
bits == 32);
|
||||
|
||||
assert(type == GL_UNSIGNED_BYTE ||
|
||||
type == GL_UNSIGNED_SHORT ||
|
||||
type == GL_FLOAT);
|
||||
|
||||
ctx = OSMesaCreateContextExt(OSMESA_BGRA, z, stencil, accum, NULL );
|
||||
if (!ctx) {
|
||||
printf("OSMesaCreateContextExt() failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Allocate the image buffer */
|
||||
buffer = malloc(WIDTH * HEIGHT * 4 * bits / 8);
|
||||
if (!buffer) {
|
||||
printf("Alloc image buffer failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Bind the buffer to the context and make it current */
|
||||
if (!OSMesaMakeCurrent( ctx, buffer, type, WIDTH, HEIGHT )) {
|
||||
printf("OSMesaMakeCurrent (%d bits/channel) failed!\n", bits);
|
||||
free(buffer);
|
||||
OSMesaDestroyContext(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* sanity checks */
|
||||
glGetIntegerv(GL_RED_BITS, &cBits);
|
||||
if (cBits != bits) {
|
||||
fprintf(stderr, "Unable to create %d-bit/channel renderbuffer.\n", bits);
|
||||
fprintf(stderr, "May need to recompile Mesa with CHAN_BITS=16 or 32.\n");
|
||||
return 0;
|
||||
}
|
||||
glGetIntegerv(GL_GREEN_BITS, &cBits);
|
||||
assert(cBits == bits);
|
||||
glGetIntegerv(GL_BLUE_BITS, &cBits);
|
||||
assert(cBits == bits);
|
||||
glGetIntegerv(GL_ALPHA_BITS, &cBits);
|
||||
assert(cBits == bits);
|
||||
|
||||
if (WriteFiles)
|
||||
printf("Rendering %d bit/channel image: %s\n", bits, filename);
|
||||
else
|
||||
printf("Rendering %d bit/channel image\n", bits);
|
||||
|
||||
OSMesaColorClamp(GL_TRUE);
|
||||
|
||||
init_context();
|
||||
render_image();
|
||||
if (Gradient)
|
||||
render_gradient();
|
||||
|
||||
/* Make sure buffered commands are finished! */
|
||||
glFinish();
|
||||
|
||||
if (DisplayImages && filename != NULL) {
|
||||
if (type == GL_UNSIGNED_SHORT) {
|
||||
GLushort *buffer16 = (GLushort *) buffer;
|
||||
GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
|
||||
int i;
|
||||
for (i = 0; i < WIDTH * HEIGHT * 4; i++)
|
||||
buffer8[i] = buffer16[i] >> 8;
|
||||
display_image(filename, buffer8, WIDTH, HEIGHT);
|
||||
free(buffer8);
|
||||
}
|
||||
else if (type == GL_FLOAT) {
|
||||
GLfloat *buffer32 = (GLfloat *) buffer;
|
||||
GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
|
||||
int i;
|
||||
/* colors may be outside [0,1] so we need to clamp */
|
||||
for (i = 0; i < WIDTH * HEIGHT * 4; i++)
|
||||
buffer8[i] = (GLubyte) (buffer32[i] * 255.0);
|
||||
display_image(filename, buffer8, WIDTH, HEIGHT);
|
||||
free(buffer8);
|
||||
}
|
||||
else {
|
||||
display_image(filename, (const GLubyte *)buffer, WIDTH, HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
if (WriteFiles && filename != NULL) {
|
||||
if (type == GL_UNSIGNED_SHORT) {
|
||||
GLushort *buffer16 = (GLushort *) buffer;
|
||||
GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
|
||||
int i;
|
||||
for (i = 0; i < WIDTH * HEIGHT * 4; i++)
|
||||
buffer8[i] = buffer16[i] >> 8;
|
||||
write_ppm(filename, buffer8, WIDTH, HEIGHT);
|
||||
free(buffer8);
|
||||
}
|
||||
else if (type == GL_FLOAT) {
|
||||
GLfloat *buffer32 = (GLfloat *) buffer;
|
||||
GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
|
||||
int i;
|
||||
/* colors may be outside [0,1] so we need to clamp */
|
||||
for (i = 0; i < WIDTH * HEIGHT * 4; i++)
|
||||
buffer8[i] = (GLubyte) (buffer32[i] * 255.0);
|
||||
write_ppm(filename, buffer8, WIDTH, HEIGHT);
|
||||
free(buffer8);
|
||||
}
|
||||
else {
|
||||
write_ppm(filename, (const GLubyte *)buffer, WIDTH, HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
OSMesaDestroyContext(ctx);
|
||||
|
||||
free(buffer);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main( int argc, char *argv[] )
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Use -f to write image files\n");
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-d") == 0)
|
||||
DisplayImages = GL_TRUE;
|
||||
else if (strcmp(argv[i], "-f") == 0)
|
||||
WriteFiles = GL_TRUE;
|
||||
else if (strcmp(argv[i], "-g") == 0)
|
||||
Gradient = GL_TRUE;
|
||||
}
|
||||
|
||||
test(GL_UNSIGNED_BYTE, 8, "image8.ppm");
|
||||
test(GL_UNSIGNED_SHORT, 16, "image16.ppm");
|
||||
test(GL_FLOAT, 32, "image32.ppm");
|
||||
|
||||
return 0;
|
||||
}
|
||||
18
recipes/demos/osdemo/recipe.toml
Normal file
18
recipes/demos/osdemo/recipe.toml
Normal file
@ -0,0 +1,18 @@
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"liborbital",
|
||||
"llvm18",
|
||||
"mesa",
|
||||
"mesa-glu",
|
||||
"zlib"
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
cp "${COOKBOOK_SOURCE}/../osdemo.c" ./osdemo.c
|
||||
${CXX} -O2 -I "${COOKBOOK_SYSROOT}/include" $LDFLAGS osdemo.c -o osdemo \
|
||||
-lorbital $("${PKG_CONFIG}" --libs glu) -lz
|
||||
mkdir -pv "${COOKBOOK_STAGE}/usr/bin"
|
||||
cp -v "osdemo" "${COOKBOOK_STAGE}/usr/bin/osdemo"
|
||||
"""
|
||||
19
recipes/demos/pixelcannon/recipe.toml
Normal file
19
recipes/demos/pixelcannon/recipe.toml
Normal file
@ -0,0 +1,19 @@
|
||||
[source]
|
||||
git = "https://github.com/jackpot51/pixelcannon.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
cookbook_cargo
|
||||
|
||||
mkdir -pv "${COOKBOOK_STAGE}/apps/pixelcannon"
|
||||
cp -Rv "${COOKBOOK_SOURCE}/assets" "${COOKBOOK_STAGE}/apps/pixelcannon"
|
||||
|
||||
mkdir -pv "${COOKBOOK_STAGE}/ui/apps"
|
||||
cp -v "${COOKBOOK_SOURCE}/manifest" "${COOKBOOK_STAGE}/ui/apps/pixelcannon"
|
||||
"""
|
||||
|
||||
[package]
|
||||
dependencies = [
|
||||
"orbital",
|
||||
]
|
||||
BIN
recipes/demos/sdl2-gears/assets/font.ttf
Normal file
BIN
recipes/demos/sdl2-gears/assets/font.ttf
Normal file
Binary file not shown.
BIN
recipes/demos/sdl2-gears/assets/image.png
Normal file
BIN
recipes/demos/sdl2-gears/assets/image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
BIN
recipes/demos/sdl2-gears/assets/music.wav
Normal file
BIN
recipes/demos/sdl2-gears/assets/music.wav
Normal file
Binary file not shown.
523
recipes/demos/sdl2-gears/gears.c
Normal file
523
recipes/demos/sdl2-gears/gears.c
Normal file
@ -0,0 +1,523 @@
|
||||
/* gears.c */
|
||||
|
||||
/*
|
||||
* 3-D gear wheels. This program is in the public domain.
|
||||
*
|
||||
* Brian Paul
|
||||
*/
|
||||
|
||||
/* Conversion to GLUT by Mark J. Kilgard */
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_opengl.h>
|
||||
#include <SDL2/SDL_image.h>
|
||||
#include <SDL2/SDL_mixer.h>
|
||||
#include <SDL2/SDL_ttf.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Draw a gear wheel. You'll probably want to call this function when
|
||||
building a display list since we do a lot of trig here.
|
||||
|
||||
Input: inner_radius - radius of hole at center
|
||||
outer_radius - radius at center of teeth
|
||||
width - width of gear
|
||||
teeth - number of teeth
|
||||
tooth_depth - depth of tooth
|
||||
|
||||
**/
|
||||
|
||||
static void
|
||||
gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
|
||||
GLint teeth, GLfloat tooth_depth)
|
||||
{
|
||||
GLint i;
|
||||
GLfloat r0, r1, r2;
|
||||
GLfloat angle, da;
|
||||
GLfloat u, v, len;
|
||||
|
||||
r0 = inner_radius;
|
||||
r1 = outer_radius - tooth_depth / 2.0;
|
||||
r2 = outer_radius + tooth_depth / 2.0;
|
||||
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
glNormal3f(0.0, 0.0, 1.0);
|
||||
|
||||
/* draw front face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++)
|
||||
{
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw front sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
for (i = 0; i < teeth; i++)
|
||||
{
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
glNormal3f(0.0, 0.0, -1.0);
|
||||
|
||||
/* draw back face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++)
|
||||
{
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw back sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
for (i = 0; i < teeth; i++)
|
||||
{
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw outward faces of teeth */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i < teeth; i++)
|
||||
{
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
u = r2 * cos(angle + da) - r1 * cos(angle);
|
||||
v = r2 * sin(angle + da) - r1 * sin(angle);
|
||||
len = sqrt(u * u + v * v);
|
||||
u /= len;
|
||||
v /= len;
|
||||
glNormal3f(v, -u, 0.0);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
|
||||
glNormal3f(cos(angle), sin(angle), 0.0);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
|
||||
u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
|
||||
v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
|
||||
glNormal3f(v, -u, 0.0);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
|
||||
glNormal3f(cos(angle), sin(angle), 0.0);
|
||||
}
|
||||
|
||||
glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
|
||||
glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
|
||||
|
||||
glEnd();
|
||||
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
/* draw inside radius cylinder */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++)
|
||||
{
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glNormal3f(-cos(angle), -sin(angle), 0.0);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static int width = 800;
|
||||
static int height = 600;
|
||||
|
||||
static SDL_Window *window = NULL;
|
||||
static SDL_GLContext context = NULL;
|
||||
|
||||
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
|
||||
static GLint gear1, gear2, gear3;
|
||||
static GLfloat angle = 0.0;
|
||||
static GLfloat delta = 2.0f;
|
||||
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(view_rotx, 1.0, 0.0, 0.0);
|
||||
glRotatef(view_roty, 0.0, 1.0, 0.0);
|
||||
glRotatef(view_rotz, 0.0, 0.0, 1.0);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.0, -2.0, 0.0);
|
||||
glRotatef(angle, 0.0, 0.0, 1.0);
|
||||
glCallList(gear1);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(3.1, -2.0, 0.0);
|
||||
glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
|
||||
glCallList(gear2);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.1, 4.2, 0.0);
|
||||
glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
|
||||
glCallList(gear3);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
static void
|
||||
idle(void)
|
||||
{
|
||||
angle += delta;
|
||||
if (angle > 360.0f)
|
||||
angle -= 360.0f;
|
||||
|
||||
draw();
|
||||
|
||||
SDL_GL_SwapWindow(window);
|
||||
}
|
||||
|
||||
/* new window size or exposure */
|
||||
static void
|
||||
reshape(int width, int height)
|
||||
{
|
||||
GLfloat h = (GLfloat)height / (GLfloat)width;
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
}
|
||||
|
||||
static void
|
||||
init(void)
|
||||
{
|
||||
static GLfloat pos[4] =
|
||||
{5.0, 5.0, 10.0, 0.0};
|
||||
static GLfloat red[4] =
|
||||
{0.8, 0.1, 0.0, 1.0};
|
||||
static GLfloat green[4] =
|
||||
{0.0, 0.8, 0.2, 1.0};
|
||||
static GLfloat blue[4] =
|
||||
{0.2, 0.2, 1.0, 1.0};
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, pos);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
/* make the gears */
|
||||
gear1 = glGenLists(1);
|
||||
glNewList(gear1, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
|
||||
gear(1.0, 4.0, 1.0, 20, 0.7);
|
||||
glEndList();
|
||||
|
||||
gear2 = glGenLists(1);
|
||||
glNewList(gear2, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
|
||||
gear(0.5, 2.0, 2.0, 10, 0.7);
|
||||
glEndList();
|
||||
|
||||
gear3 = glGenLists(1);
|
||||
glNewList(gear3, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
|
||||
gear(1.3, 2.0, 0.5, 10, 0.7);
|
||||
glEndList();
|
||||
|
||||
glEnable(GL_NORMALIZE);
|
||||
}
|
||||
|
||||
void CheckSDLError(int line)
|
||||
{
|
||||
const char *error = SDL_GetError();
|
||||
if (error != "")
|
||||
{
|
||||
printf("SLD Error: %s\n", error);
|
||||
|
||||
if (line != -1)
|
||||
printf("\nLine: %d\n", line);
|
||||
|
||||
SDL_ClearError();
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Surface *image;
|
||||
const char *IMAGE_FILE_NAME = "/usr/games/sdl2_gears/assets/image.png";
|
||||
|
||||
Mix_Music *music = NULL;
|
||||
const char *MUSIC_FILE_NAME = "/usr/games/sdl2_gears/assets/music.wav";
|
||||
|
||||
TTF_Font *font = NULL;
|
||||
const char *TTF_FILE_NAME = "/usr/games/sdl2_gears/assets/font.ttf";
|
||||
|
||||
void cleanup()
|
||||
{
|
||||
if (context != NULL)
|
||||
{
|
||||
SDL_GL_DeleteContext(context);
|
||||
context = NULL;
|
||||
}
|
||||
if (window != NULL)
|
||||
{
|
||||
SDL_DestroyWindow(window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
if (image != NULL)
|
||||
{
|
||||
SDL_FreeSurface(image);
|
||||
image = NULL;
|
||||
IMG_Quit();
|
||||
}
|
||||
|
||||
if (music != NULL)
|
||||
{
|
||||
Mix_FreeMusic(music);
|
||||
music = NULL;
|
||||
Mix_CloseAudio();
|
||||
}
|
||||
|
||||
if (font != NULL)
|
||||
{
|
||||
TTF_CloseFont(font);
|
||||
font = NULL;
|
||||
}
|
||||
|
||||
// Shutdown SDL 2
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// Main
|
||||
printf("Initializing SDL\n");
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0)
|
||||
{
|
||||
printf("Failed to init SDL\n");
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Video / window
|
||||
printf("Creating SDL window\n");
|
||||
window = SDL_CreateWindow(
|
||||
"Gears",
|
||||
-1,
|
||||
-1,
|
||||
width,
|
||||
height,
|
||||
SDL_WINDOW_OPENGL);
|
||||
if (window == NULL)
|
||||
{
|
||||
printf("Unable to create window\n");
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Creating SDL GL context\n");
|
||||
context = SDL_GL_CreateContext(window);
|
||||
if (context == NULL)
|
||||
{
|
||||
printf("Unable to create SDL GL context\n");
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
reshape(width, height);
|
||||
|
||||
// Image
|
||||
printf("Initializing SDL image supporting formats png and jpeg\n");
|
||||
int flags = IMG_INIT_JPG | IMG_INIT_PNG;
|
||||
int initted = IMG_Init(flags);
|
||||
if ((initted & flags) != flags)
|
||||
{
|
||||
printf("IMG_Init: Failed to init required jpg and png support: %s\n", IMG_GetError());
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
image = IMG_Load(IMAGE_FILE_NAME);
|
||||
if (image == NULL)
|
||||
{
|
||||
printf("IMG_Load failed: %s\n", IMG_GetError());
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Audio
|
||||
printf("Opening SDL mixer audio\n");
|
||||
if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096) < 0)
|
||||
{
|
||||
fprintf(stderr, "Couldn't open audio mixer: %s\n", SDL_GetError());
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
music = Mix_LoadMUS(MUSIC_FILE_NAME);
|
||||
if (music == NULL)
|
||||
{
|
||||
fprintf(stderr, "Couldn't open audio file %s: %s\n", MUSIC_FILE_NAME, SDL_GetError());
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (Mix_PlayMusic(music, -1) < 0)
|
||||
{
|
||||
fprintf(stderr, "Couldn't play music: %s\n", SDL_GetError());
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// TTF
|
||||
printf("Initializing TTF\n");
|
||||
if (TTF_Init() < 0)
|
||||
{
|
||||
printf("Failed to init TTF\n");
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
font = TTF_OpenFont(TTF_FILE_NAME, 30);
|
||||
if (font == NULL)
|
||||
{
|
||||
printf("Couldn't open TTF file %s: %s\n", TTF_FILE_NAME, SDL_GetError());
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
|
||||
int running = 1;
|
||||
SDL_Event event;
|
||||
int playing_audio = 0;
|
||||
while (running)
|
||||
{
|
||||
idle();
|
||||
|
||||
// Loop track
|
||||
Mix_PlayingMusic();
|
||||
|
||||
while (SDL_PollEvent(&event))
|
||||
{
|
||||
if (event.type == SDL_QUIT)
|
||||
running = 0;
|
||||
|
||||
if (event.type == SDL_KEYDOWN)
|
||||
{
|
||||
switch (event.key.keysym.sym)
|
||||
{
|
||||
case SDLK_p:
|
||||
{
|
||||
if (!Mix_PlayingMusic())
|
||||
{
|
||||
if (Mix_PlayMusic(music, -1) < 0)
|
||||
{
|
||||
fprintf(stderr, "Couldn't play music: %s\n", SDL_GetError());
|
||||
CheckSDLError(__LINE__);
|
||||
cleanup();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Mix_PausedMusic())
|
||||
{
|
||||
Mix_ResumeMusic();
|
||||
}
|
||||
else
|
||||
{
|
||||
Mix_PauseMusic();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SDLK_a:
|
||||
case SDLK_LEFT:
|
||||
{
|
||||
delta -= 0.2f;
|
||||
break;
|
||||
}
|
||||
case SDLK_d:
|
||||
case SDLK_RIGHT:
|
||||
{
|
||||
delta += 0.2f;
|
||||
break;
|
||||
}
|
||||
case SDLK_ESCAPE:
|
||||
{
|
||||
running = 0;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.type == SDL_MOUSEBUTTONDOWN)
|
||||
{
|
||||
if (event.button.button == SDL_BUTTON_LEFT)
|
||||
{
|
||||
printf("Left mouse btn pressed at position %d,%d\n", event.button.x, event.button.y);
|
||||
}
|
||||
else if (event.button.button == SDL_BUTTON_MIDDLE)
|
||||
{
|
||||
printf("Middle mouse btn pressed at position %d,%d\n", event.button.x, event.button.y);
|
||||
}
|
||||
else if (event.button.button == SDL_BUTTON_RIGHT)
|
||||
{
|
||||
printf("Right mouse btn pressed at position %d,%d\n", event.button.x, event.button.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Delay(10);
|
||||
}
|
||||
|
||||
cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
17
recipes/demos/sdl2-gears/recipe.toml
Normal file
17
recipes/demos/sdl2-gears/recipe.toml
Normal file
@ -0,0 +1,17 @@
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"sdl2-image",
|
||||
"sdl2-mixer",
|
||||
"sdl2-ttf",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
mkdir -p "${COOKBOOK_STAGE}/usr/games/sdl2_gears"
|
||||
${CXX} -O2 -I "${COOKBOOK_SYSROOT}/include" $LDFLAGS ${COOKBOOK_RECIPE}/gears.c \
|
||||
-o sdl2_gears -dynamic \
|
||||
-lSDL2_image -lSDL2_mixer -lSDL2_ttf $("${PKG_CONFIG}" --libs osmesa) \
|
||||
-lSDL2 -lorbital -lfreetype -lpng -ljpeg -lvorbisfile -lvorbis -logg -lz
|
||||
cp -rv "${COOKBOOK_RECIPE}/assets" "${COOKBOOK_STAGE}/usr/games/sdl2_gears/"
|
||||
cp -v sdl2_gears "${COOKBOOK_STAGE}/usr/games/sdl2_gears/"
|
||||
"""
|
||||
9
recipes/demos/winit/recipe.toml
Normal file
9
recipes/demos/winit/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://github.com/pop-os/winit.git"
|
||||
branch = "winit-0.29"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
cookbook_cargo_examples cursor_grab drag_window window window_debug
|
||||
"""
|
||||
6
recipes/dev/autoconf/recipe.toml
Normal file
6
recipes/dev/autoconf/recipe.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[source]
|
||||
tar = "https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz"
|
||||
blake3 = "da1cc8af8551c343de9f42af0ae53fd7dff3623487157623892b6cd7e3bb5692"
|
||||
|
||||
[build]
|
||||
template = "configure"
|
||||
6
recipes/dev/automake/recipe.toml
Normal file
6
recipes/dev/automake/recipe.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[source]
|
||||
tar = "https://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.xz"
|
||||
blake3 = "f42cfc333aaaa11f2bcb05b5b0273b8706c820c22f9ba4367f7eb920551695cd"
|
||||
|
||||
[build]
|
||||
template = "configure"
|
||||
33
recipes/dev/cargo/recipe.toml
Normal file
33
recipes/dev/cargo/recipe.toml
Normal file
@ -0,0 +1,33 @@
|
||||
[source]
|
||||
git = "https://github.com/rust-lang/cargo.git"
|
||||
rev = "d73d2caf9e41a39daf2a8d6ce60ec80bf354d2a7" # 0.86
|
||||
patches = [
|
||||
"redox.patch"
|
||||
]
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"curl",
|
||||
"libssh2",
|
||||
"nghttp2",
|
||||
"openssl1",
|
||||
"zlib",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
||||
export LIBZ_SYS_STATIC=1
|
||||
export DEP_NGHTTP2_ROOT="${COOKBOOK_SYSROOT}"
|
||||
export DEP_OPENSSL_ROOT="${COOKBOOK_SYSROOT}"
|
||||
export DEP_Z_ROOT="${COOKBOOK_SYSROOT}"
|
||||
"${COOKBOOK_CARGO}" rustc \
|
||||
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
|
||||
--release \
|
||||
--bin cargo \
|
||||
-- \
|
||||
-L "${COOKBOOK_SYSROOT}/lib" \
|
||||
-C link-arg=-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib
|
||||
mkdir -pv "${COOKBOOK_STAGE}/usr/bin"
|
||||
cp -v "target/${TARGET}/release/cargo" "${COOKBOOK_STAGE}/usr/bin/cargo"
|
||||
"""
|
||||
37
recipes/dev/cargo/redox.patch
Normal file
37
recipes/dev/cargo/redox.patch
Normal file
@ -0,0 +1,37 @@
|
||||
diff --git a/crates/cargo-util/src/paths.rs b/crates/cargo-util/src/paths.rs
|
||||
index 5d7e3c5a6..b7de5655f 100644
|
||||
--- a/crates/cargo-util/src/paths.rs
|
||||
+++ b/crates/cargo-util/src/paths.rs
|
||||
@@ -201,7 +201,7 @@ pub fn write_atomic<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Res
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
|
||||
// these constants are u16 on macOS
|
||||
- let mask = u32::from(libc::S_IRWXU | libc::S_IRWXG | libc::S_IRWXO);
|
||||
+ let mask = (libc::S_IRWXU | libc::S_IRWXG | libc::S_IRWXO) as u32;
|
||||
let mode = meta.permissions().mode() & mask;
|
||||
|
||||
std::fs::Permissions::from_mode(mode)
|
||||
@@ -611,8 +611,6 @@ fn _link_or_copy(src: &Path, dst: &Path) -> Result<()> {
|
||||
}
|
||||
|
||||
let link_result = if src.is_dir() {
|
||||
- #[cfg(target_os = "redox")]
|
||||
- use std::os::redox::fs::symlink;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::symlink;
|
||||
#[cfg(windows)]
|
||||
diff --git a/src/cargo/core/compiler/build_config.rs b/src/cargo/core/compiler/build_config.rs
|
||||
index 80aa592dd..d40c2056b 100644
|
||||
--- a/src/cargo/core/compiler/build_config.rs
|
||||
+++ b/src/cargo/core/compiler/build_config.rs
|
||||
@@ -51,9 +51,7 @@ pub struct BuildConfig {
|
||||
}
|
||||
|
||||
fn default_parallelism() -> CargoResult<u32> {
|
||||
- Ok(available_parallelism()
|
||||
- .context("failed to determine the amount of parallelism available")?
|
||||
- .get() as u32)
|
||||
+ Ok(1)
|
||||
}
|
||||
|
||||
impl BuildConfig {
|
||||
43
recipes/dev/cmake/recipe.toml
Normal file
43
recipes/dev/cmake/recipe.toml
Normal file
@ -0,0 +1,43 @@
|
||||
[source]
|
||||
tar = "https://github.com/Kitware/CMake/releases/download/v4.0.3/cmake-4.0.3.tar.gz"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"bzip2",
|
||||
# "cppdap",
|
||||
"curl",
|
||||
"expat",
|
||||
# "form",
|
||||
# "jsoncpp",
|
||||
"libarchive",
|
||||
# "liblzma",
|
||||
# "librhash",
|
||||
"libuv",
|
||||
"nghttp2",
|
||||
"openssl1",
|
||||
"zlib",
|
||||
"zstd",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
COOKBOOK_CMAKE_FLAGS+=(
|
||||
-DBUILD_TESTING=Off
|
||||
-DCMAKE_USE_SYSTEM_BZIP2=On
|
||||
-DCMAKE_USE_SYSTEM_CURL=On
|
||||
-DCMAKE_USE_SYSTEM_EXPAT=On
|
||||
-DCMAKE_USE_SYSTEM_LIBARCHIVE=On
|
||||
-DCMAKE_USE_SYSTEM_LIBUV=On
|
||||
-DCMAKE_USE_SYSTEM_NGHTTP2=On
|
||||
-DCMAKE_USE_SYSTEM_ZLIB=On
|
||||
-DCMAKE_USE_SYSTEM_ZSTD=On
|
||||
)
|
||||
cookbook_cmake
|
||||
set -x
|
||||
mv -vT "${COOKBOOK_STAGE}"/usr/bin "${COOKBOOK_STAGE}/bin"
|
||||
mv -vT "${COOKBOOK_STAGE}"/usr/share "${COOKBOOK_STAGE}/share"
|
||||
rm -rf "${COOKBOOK_STAGE}"/usr/doc
|
||||
rmdir -v "${COOKBOOK_STAGE}"/usr
|
||||
set +x
|
||||
"""
|
||||
9
recipes/dev/composer/recipe.toml
Normal file
9
recipes/dev/composer/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
#TODO must be run using `php $(which composer)`
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
mkdir -p "${COOKBOOK_STAGE}"/usr/bin
|
||||
wget -c https://getcomposer.org/download/2.8.12/composer.phar
|
||||
chmod a+x composer.phar
|
||||
cp composer.phar ${COOKBOOK_STAGE}/usr/bin/composer
|
||||
"""
|
||||
11
recipes/dev/crates-io-index/recipe.toml
Normal file
11
recipes/dev/crates-io-index/recipe.toml
Normal file
@ -0,0 +1,11 @@
|
||||
[source]
|
||||
git = "https://github.com/rust-lang/crates.io-index.git"
|
||||
shallow_clone = true
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
dir="${COOKBOOK_STAGE}/home/user/.cargo/registry/index/github.com-1ecc6299db9ec823"
|
||||
mkdir -pv "${dir}"
|
||||
cp -rv "${COOKBOOK_SOURCE}/.git" "${dir}"
|
||||
"""
|
||||
29
recipes/dev/fontconfig/recipe.toml
Normal file
29
recipes/dev/fontconfig/recipe.toml
Normal file
@ -0,0 +1,29 @@
|
||||
[source]
|
||||
tar = "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.16.0.tar.xz"
|
||||
blake3 = "5c95d48f5b9150f4a06d8acac12c25edaac956007df95a3bf527df02a5908f0e"
|
||||
patches = [
|
||||
"redox.patch"
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
autotools_recursive_regenerate
|
||||
"""
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"expat",
|
||||
"freetype2",
|
||||
"libpng",
|
||||
"zlib",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--disable-docs \
|
||||
ac_cv_func_XML_SetDoctypeDeclHandler=yes
|
||||
)
|
||||
export V=1
|
||||
export LIBS="-lpng -lz"
|
||||
cookbook_configure
|
||||
"""
|
||||
33
recipes/dev/fontconfig/redox.patch
Normal file
33
recipes/dev/fontconfig/redox.patch
Normal file
@ -0,0 +1,33 @@
|
||||
diff -ruwN source/src/fccache.c source-new/src/fccache.c
|
||||
--- source/src/fccache.c 2019-06-10 05:36:37.000000000 -0600
|
||||
+++ source-new/src/fccache.c 2019-10-02 19:48:10.459642095 -0600
|
||||
@@ -1526,7 +1526,7 @@
|
||||
#if defined(_WIN32)
|
||||
if (_locking (fd, _LK_LOCK, 1) == -1)
|
||||
goto bail;
|
||||
-#else
|
||||
+#elif !defined(__redox__)
|
||||
struct flock fl;
|
||||
|
||||
fl.l_type = F_WRLCK;
|
||||
@@ -1556,7 +1556,7 @@
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
_locking (fd, _LK_UNLCK, 1);
|
||||
-#else
|
||||
+#elif !defined(__redox__)
|
||||
struct flock fl;
|
||||
|
||||
fl.l_type = F_UNLCK;
|
||||
diff -ruwN source/src/fccharset.c source-new/src/fccharset.c
|
||||
--- source/src/fccharset.c 2018-06-05 04:36:38.000000000 -0600
|
||||
+++ source-new/src/fccharset.c 2019-10-02 19:48:53.082862133 -0600
|
||||
@@ -600,7 +600,7 @@
|
||||
static FcChar32
|
||||
FcCharSetPopCount (FcChar32 c1)
|
||||
{
|
||||
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
|
||||
+#if !defined(__redox__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
||||
return __builtin_popcount (c1);
|
||||
#else
|
||||
/* hackmem 169 */
|
||||
47
recipes/dev/gcc13/recipe.toml
Normal file
47
recipes/dev/gcc13/recipe.toml
Normal file
@ -0,0 +1,47 @@
|
||||
[source]
|
||||
tar = "https://gitlab.redox-os.org/redox-os/gcc/-/archive/redox-13.2.0/gcc-redox-13.2.0.tar.gz"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
COOKBOOK_AUTORECONF=autoreconf2.69 autotools_recursive_regenerate -I"$(realpath ./config)"
|
||||
cp -fpv "${COOKBOOK_HOST_SYSROOT}"/share/libtool/build-aux/{config.sub,config.guess,install-sh} libiberty/
|
||||
"""
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"libgmp",
|
||||
"libmpfr",
|
||||
"mpc",
|
||||
"zlib"
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
mkdir -p "${COOKBOOK_SYSROOT}/usr"
|
||||
ln -sf "${COOKBOOK_SYSROOT}/include" "${COOKBOOK_SYSROOT}/usr/include"
|
||||
ln -sf "${COOKBOOK_SYSROOT}/lib" "${COOKBOOK_SYSROOT}/usr/lib"
|
||||
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--target="${GNU_TARGET}"
|
||||
--with-sysroot=/
|
||||
--with-build-sysroot="${COOKBOOK_SYSROOT}"
|
||||
--enable-languages=c,c++,lto
|
||||
--enable-initfini-array
|
||||
--disable-multilib
|
||||
--with-system-zlib
|
||||
--enable-host-shared
|
||||
--with-bugurl="https://gitlab.redox-os.org/redox-os/gcc/-/issues"
|
||||
)
|
||||
|
||||
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
|
||||
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" all-gcc all-target-libgcc all-target-libstdc++-v3
|
||||
"${COOKBOOK_MAKE}" install-gcc install-target-libgcc install-target-libstdc++-v3 DESTDIR="${COOKBOOK_STAGE}"
|
||||
ln -s "gcc" "${COOKBOOK_STAGE}/usr/bin/cc"
|
||||
# Avoid conflict with libgcc & libstdcxx
|
||||
rm -f "${COOKBOOK_STAGE}"/usr/lib/libgcc_s.so* "${COOKBOOK_STAGE}"/usr/lib/libstdc++.so*
|
||||
"""
|
||||
|
||||
[package]
|
||||
dependencies = [
|
||||
"gnu-binutils"
|
||||
]
|
||||
5
recipes/dev/gdbserver/recipe.toml
Normal file
5
recipes/dev/gdbserver/recipe.toml
Normal file
@ -0,0 +1,5 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/gdbserver.git"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
23
recipes/dev/gdk-pixbuf/recipe.toml
Normal file
23
recipes/dev/gdk-pixbuf/recipe.toml
Normal file
@ -0,0 +1,23 @@
|
||||
[source]
|
||||
tar = "https://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.44/gdk-pixbuf-2.44.4.tar.xz"
|
||||
blake3 = "94db7bebffbd6be84a1b58a05771e411e9f7c16b06d73fcedaf0e6c0e552be9c"
|
||||
patches = ["redox.patch"]
|
||||
|
||||
[build]
|
||||
dependencies = [
|
||||
"gettext",
|
||||
"glib",
|
||||
"libffi",
|
||||
"libiconv",
|
||||
"libjpeg",
|
||||
"libpng",
|
||||
"pcre2",
|
||||
"shared-mime-info",
|
||||
"zlib",
|
||||
]
|
||||
template = "meson"
|
||||
mesonflags = [
|
||||
"-Dbuiltin_loaders=all",
|
||||
"-Dinstalled_tests=false",
|
||||
"-Dman=false",
|
||||
]
|
||||
17
recipes/dev/gdk-pixbuf/redox.patch
Normal file
17
recipes/dev/gdk-pixbuf/redox.patch
Normal file
@ -0,0 +1,17 @@
|
||||
diff -ruwN gdk-pixbuf-2.38.1/gdk-pixbuf/meson.build source/gdk-pixbuf/meson.build
|
||||
--- gdk-pixbuf-2.38.1/gdk-pixbuf/meson.build 2019-02-28 09:22:57.000000000 -0700
|
||||
+++ source/gdk-pixbuf/meson.build 2025-05-01 12:23:46.853375624 -0600
|
||||
@@ -290,9 +290,10 @@
|
||||
endif
|
||||
|
||||
gdkpixbuf_bin = [
|
||||
- [ 'gdk-pixbuf-csource' ],
|
||||
- [ 'gdk-pixbuf-pixdata' ],
|
||||
- [ 'gdk-pixbuf-query-loaders', [ 'queryloaders.c' ] ],
|
||||
+# Broken compilation on Redox
|
||||
+# [ 'gdk-pixbuf-csource' ],
|
||||
+# [ 'gdk-pixbuf-pixdata' ],
|
||||
+# [ 'gdk-pixbuf-query-loaders', [ 'queryloaders.c' ] ],
|
||||
]
|
||||
|
||||
foreach bin: gdkpixbuf_bin
|
||||
240
recipes/dev/git/git.patch
Normal file
240
recipes/dev/git/git.patch
Normal file
@ -0,0 +1,240 @@
|
||||
diff -ruwN git-2.13.1/compat/bswap.h source/compat/bswap.h
|
||||
--- git-2.13.1/compat/bswap.h 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/compat/bswap.h 2025-04-24 11:20:06.475749424 -0600
|
||||
@@ -1,3 +1,7 @@
|
||||
+#if defined(__redox__)
|
||||
+#include <machine/endian.h>
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* Let's make sure we always have a sane definition for ntohl()/htonl().
|
||||
* Some libraries define those as a function call, just to perform byte
|
||||
diff -ruwN git-2.13.1/compat/terminal.c source/compat/terminal.c
|
||||
--- git-2.13.1/compat/terminal.c 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/compat/terminal.c 2025-04-18 10:00:11.318697446 -0600
|
||||
@@ -137,6 +137,18 @@
|
||||
return buf.buf;
|
||||
}
|
||||
|
||||
+#elif defined(__redox__)
|
||||
+
|
||||
+ssize_t __getline(char **lptr, size_t *n, FILE *fp);
|
||||
+
|
||||
+char *git_terminal_prompt(const char *prompt, int echo)
|
||||
+{
|
||||
+ char *line = NULL;
|
||||
+ size_t n = 0;
|
||||
+ __getline(&line, &n, stdin);
|
||||
+ return line; // XXX leak
|
||||
+}
|
||||
+
|
||||
#else
|
||||
|
||||
char *git_terminal_prompt(const char *prompt, int echo)
|
||||
diff -ruwN git-2.13.1/configure source/configure
|
||||
--- git-2.13.1/configure 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/configure 2025-04-18 10:00:11.318697446 -0600
|
||||
@@ -6156,7 +6156,7 @@
|
||||
ac_res=$ac_cv_search_getaddrinfo
|
||||
if test "$ac_res" != no; then :
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
- NO_IPV6=
|
||||
+ NO_IPV6=YesPlease
|
||||
else
|
||||
NO_IPV6=YesPlease
|
||||
fi
|
||||
diff -ruwN git-2.13.1/daemon.c source/daemon.c
|
||||
--- git-2.13.1/daemon.c 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/daemon.c 2025-04-18 10:00:11.319697447 -0600
|
||||
@@ -71,13 +71,21 @@
|
||||
return hi->ip_address.buf;
|
||||
}
|
||||
|
||||
+#if defined(__redox__)
|
||||
+#define LOG_ERR 0
|
||||
+#define LOG_INFO 1
|
||||
+#endif
|
||||
+
|
||||
static void logreport(int priority, const char *err, va_list params)
|
||||
{
|
||||
+#if !defined(__redox__)
|
||||
if (log_syslog) {
|
||||
char buf[1024];
|
||||
vsnprintf(buf, sizeof(buf), err, params);
|
||||
syslog(priority, "%s", buf);
|
||||
- } else {
|
||||
+ } else
|
||||
+#endif
|
||||
+ {
|
||||
/*
|
||||
* Since stderr is set to buffered mode, the
|
||||
* logging of different processes will not overlap
|
||||
@@ -888,8 +896,12 @@
|
||||
|
||||
if (!reuseaddr)
|
||||
return 0;
|
||||
+#if defined(__redox__)
|
||||
+ return 0;
|
||||
+#else
|
||||
return setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR,
|
||||
&on, sizeof(on));
|
||||
+#endif
|
||||
}
|
||||
|
||||
struct socketlist {
|
||||
@@ -1174,11 +1186,7 @@
|
||||
if (!group_name)
|
||||
c.gid = c.pass->pw_gid;
|
||||
else {
|
||||
- struct group *group = getgrnam(group_name);
|
||||
- if (!group)
|
||||
die("group not found - %s", group_name);
|
||||
-
|
||||
- c.gid = group->gr_gid;
|
||||
}
|
||||
|
||||
return &c;
|
||||
@@ -1348,10 +1356,12 @@
|
||||
usage(daemon_usage);
|
||||
}
|
||||
|
||||
+#if !defined(__redox__)
|
||||
if (log_syslog) {
|
||||
openlog("git-daemon", LOG_PID, LOG_DAEMON);
|
||||
set_die_routine(daemon_die);
|
||||
} else
|
||||
+#endif
|
||||
/* avoid splitting a message in the middle */
|
||||
setvbuf(stderr, NULL, _IOFBF, 4096);
|
||||
|
||||
diff -ruwN git-2.13.1/git-compat-util.h source/git-compat-util.h
|
||||
--- git-2.13.1/git-compat-util.h 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/git-compat-util.h 2025-04-18 10:00:11.319697447 -0600
|
||||
@@ -1,6 +1,18 @@
|
||||
#ifndef GIT_COMPAT_UTIL_H
|
||||
#define GIT_COMPAT_UTIL_H
|
||||
|
||||
+#ifndef SIG_DFL
|
||||
+#define SIG_DFL ((void (*)(int))0)
|
||||
+#endif
|
||||
+
|
||||
+#ifndef SIG_IGN
|
||||
+#define SIG_IGN ((void (*)(int))1)
|
||||
+#endif
|
||||
+
|
||||
+#ifndef SIG_ERR
|
||||
+#define SIG_ERR ((void (*)(int))-1)
|
||||
+#endif
|
||||
+
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
|
||||
@@ -323,6 +335,14 @@
|
||||
#define PATH_SEP ':'
|
||||
#endif
|
||||
|
||||
+#ifndef DEV_NULL
|
||||
+#if defined(__redox__)
|
||||
+#define DEV_NULL "/scheme/null"
|
||||
+#else
|
||||
+#define DEV_NULL "/dev/null"
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
#ifdef HAVE_PATHS_H
|
||||
#include <paths.h>
|
||||
#endif
|
||||
diff -ruwN git-2.13.1/Makefile source/Makefile
|
||||
--- git-2.13.1/Makefile 2017-06-05 08:08:11.000000000 +0700
|
||||
+++ source/Makefile 2025-09-01 04:41:10.339224568 +0700
|
||||
@@ -979,7 +979,7 @@
|
||||
BUILTIN_OBJS += builtin/write-tree.o
|
||||
|
||||
GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB)
|
||||
-EXTLIBS =
|
||||
+EXTLIBS = -lnghttp2
|
||||
|
||||
GIT_USER_AGENT = git/$(GIT_VERSION)
|
||||
|
||||
@@ -1802,7 +1802,6 @@
|
||||
|
||||
$(BUILT_INS): git$X
|
||||
$(QUIET_BUILT_IN)$(RM) $@ && \
|
||||
- ln $< $@ 2>/dev/null || \
|
||||
ln -s $< $@ 2>/dev/null || \
|
||||
cp $< $@
|
||||
|
||||
@@ -2096,7 +2095,6 @@
|
||||
|
||||
$(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
|
||||
$(QUIET_LNCP)$(RM) $@ && \
|
||||
- ln $< $@ 2>/dev/null || \
|
||||
ln -s $< $@ 2>/dev/null || \
|
||||
cp $< $@
|
||||
|
||||
@@ -2449,14 +2447,12 @@
|
||||
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
|
||||
$(RM) "$$bindir/$$p" && \
|
||||
test -z "$(NO_INSTALL_HARDLINKS)" && \
|
||||
- ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
|
||||
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
|
||||
cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
|
||||
done && \
|
||||
for p in $(BUILT_INS); do \
|
||||
$(RM) "$$execdir/$$p" && \
|
||||
test -z "$(NO_INSTALL_HARDLINKS)" && \
|
||||
- ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
|
||||
done && \
|
||||
@@ -2464,7 +2460,6 @@
|
||||
for p in $$remote_curl_aliases; do \
|
||||
$(RM) "$$execdir/$$p" && \
|
||||
test -z "$(NO_INSTALL_HARDLINKS)" && \
|
||||
- ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
|
||||
cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \
|
||||
done && \
|
||||
diff -ruwN git-2.13.1/run-command.c source/run-command.c
|
||||
--- git-2.13.1/run-command.c 2017-06-04 19:08:11.000000000 -0600
|
||||
+++ source/run-command.c 2025-04-18 10:00:11.320697447 -0600
|
||||
@@ -120,9 +120,9 @@
|
||||
#ifndef GIT_WINDOWS_NATIVE
|
||||
static inline void dup_devnull(int to)
|
||||
{
|
||||
- int fd = open("/dev/null", O_RDWR);
|
||||
+ int fd = open(DEV_NULL, O_RDWR);
|
||||
if (fd < 0)
|
||||
- die_errno(_("open /dev/null failed"));
|
||||
+ die_errno(_("open %s failed"), DEV_NULL);
|
||||
if (dup2(fd, to) < 0)
|
||||
die_errno(_("dup2(%d,%d) failed"), fd, to);
|
||||
close(fd);
|
||||
diff -ruwN git-2.13.1/setup.c source/setup.c
|
||||
--- git-2.13.1/setup.c 2017-06-05 08:08:11.000000000 +0700
|
||||
+++ source/setup.c 2025-09-01 04:41:10.339224568 +0700
|
||||
@@ -1146,11 +1146,11 @@
|
||||
/* if any standard file descriptor is missing open it to /dev/null */
|
||||
void sanitize_stdfds(void)
|
||||
{
|
||||
- int fd = open("/dev/null", O_RDWR, 0);
|
||||
+ int fd = open(DEV_NULL, O_RDWR, 0);
|
||||
while (fd != -1 && fd < 2)
|
||||
fd = dup(fd);
|
||||
if (fd == -1)
|
||||
- die_errno("open /dev/null or dup failed");
|
||||
+ die_errno("open %s or dup failed", DEV_NULL);
|
||||
if (fd > 2)
|
||||
close(fd);
|
||||
}
|
||||
@@ -1169,8 +1169,10 @@
|
||||
default:
|
||||
exit(0);
|
||||
}
|
||||
+#if !defined(__redox__)
|
||||
if (setsid() == -1)
|
||||
die_errno("setsid failed");
|
||||
+#endif
|
||||
close(0);
|
||||
close(1);
|
||||
close(2);
|
||||
47
recipes/dev/git/recipe.toml
Normal file
47
recipes/dev/git/recipe.toml
Normal file
@ -0,0 +1,47 @@
|
||||
[source]
|
||||
tar = "https://www.kernel.org/pub/software/scm/git/git-2.13.1.tar.xz"
|
||||
blake3 = "bc78271bffd60c5b8b938d8c08fd74dc2de8d21fbaf8f8e0e3155436d9263f17"
|
||||
patches = ["git.patch"]
|
||||
|
||||
[build]
|
||||
dependencies=[
|
||||
"curl",
|
||||
"expat",
|
||||
"nghttp2",
|
||||
"openssl1",
|
||||
"zlib"
|
||||
]
|
||||
template = "custom"
|
||||
script = """
|
||||
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
|
||||
DYNAMIC_INIT
|
||||
MAKEFLAGS=(
|
||||
NEEDS_SSL_WITH_CURL=1
|
||||
NEEDS_CRYPTO_WITH_SSL=1
|
||||
NO_IPV6=1
|
||||
NO_PREAD=1
|
||||
NO_MMAP=1
|
||||
NO_SETITIMER=1
|
||||
NO_UNIX_SOCKETS=1
|
||||
NEEDS_LIBICONV=
|
||||
NEEDS_LIBRT=
|
||||
BLK_SHA1=1
|
||||
V=1
|
||||
)
|
||||
export CURL_CONFIG="${COOKBOOK_SYSROOT}/usr/bin/curl-config"
|
||||
./configure \
|
||||
--host="${GNU_TARGET}" \
|
||||
--prefix=/usr \
|
||||
ac_cv_fread_reads_directories=yes \
|
||||
ac_cv_snprintf_returns_bogus=yes \
|
||||
ac_cv_lib_curl_curl_global_init=yes
|
||||
"${COOKBOOK_MAKE}" "${MAKEFLAGS[@]}" -j"${COOKBOOK_MAKE_JOBS}"
|
||||
"${COOKBOOK_MAKE}" DESTDIR="${COOKBOOK_STAGE}" "${MAKEFLAGS[@]}" install
|
||||
rm -rf "${COOKBOOK_STAGE}/usr/share/man"
|
||||
"""
|
||||
|
||||
[package]
|
||||
dependencies = [
|
||||
"ca-certificates",
|
||||
"nghttp2"
|
||||
]
|
||||
14
recipes/dev/gitoxide/recipe.toml
Normal file
14
recipes/dev/gitoxide/recipe.toml
Normal file
@ -0,0 +1,14 @@
|
||||
[source]
|
||||
git = "https://github.com/Byron/gitoxide.git"
|
||||
|
||||
[build]
|
||||
dependencies = [
|
||||
"openssl1",
|
||||
]
|
||||
template = "custom"
|
||||
script = """
|
||||
export OPENSSL_DIR="${COOKBOOK_SYSROOT}"
|
||||
export OPENSSL_STATIC="true"
|
||||
cookbook_cargo
|
||||
"""
|
||||
|
||||
18
recipes/dev/gnu-make/recipe.toml
Normal file
18
recipes/dev/gnu-make/recipe.toml
Normal file
@ -0,0 +1,18 @@
|
||||
#TODO very basic makefiles are tested to work but needs more testing
|
||||
[source]
|
||||
tar = "http://ftp.gnu.org/gnu/make/make-4.4.tar.gz"
|
||||
patches = [
|
||||
"redox.patch"
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
autotools_recursive_regenerate
|
||||
"""
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
cp -rp "$COOKBOOK_SOURCE/." ./
|
||||
cookbook_configure
|
||||
"""
|
||||
12
recipes/dev/gnu-make/redox.patch
Normal file
12
recipes/dev/gnu-make/redox.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -ruwN make-4.4/src/arscan.c source/src/arscan.c
|
||||
--- make-4.4/src/arscan.c 2022-10-23 16:52:32.000000000 +0200
|
||||
+++ source/src/arscan.c 2024-08-23 18:28:49.206084084 +0200
|
||||
@@ -331,7 +331,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef WINDOWS32
|
||||
-# if !defined (__ANDROID__) && !defined (__BEOS__)
|
||||
+# if 0
|
||||
# include <ar.h>
|
||||
# else
|
||||
/* These platforms don't have <ar.h> but have archives in the same format
|
||||
8
recipes/dev/hello-world-examples/recipe.toml
Normal file
8
recipes/dev/hello-world-examples/recipe.toml
Normal file
@ -0,0 +1,8 @@
|
||||
[source]
|
||||
git = "https://github.com/leachim6/hello-world"
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
mkdir -pv "${COOKBOOK_STAGE}"/usr/share/hello-world-examples
|
||||
cp -rv "${COOKBOOK_SOURCE}"/[#,a-z] "${COOKBOOK_STAGE}"/usr/share/hello-world-examples
|
||||
"""
|
||||
5
recipes/dev/lci/recipe.toml
Normal file
5
recipes/dev/lci/recipe.toml
Normal file
@ -0,0 +1,5 @@
|
||||
[source]
|
||||
git = "https://github.com/jD91mZM2/rust-lci"
|
||||
|
||||
[build]
|
||||
template = "cargo"
|
||||
2
recipes/dev/llvm18/native.cmake
Normal file
2
recipes/dev/llvm18/native.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
set(CMAKE_C_COMPILER cc)
|
||||
set(CMAKE_CXX_COMPILER c++)
|
||||
70
recipes/dev/llvm18/recipe.toml
Normal file
70
recipes/dev/llvm18/recipe.toml
Normal file
@ -0,0 +1,70 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/llvm-project.git"
|
||||
upstream = "https://github.com/rust-lang/llvm-project.git"
|
||||
branch = "redox-2024-05-11"
|
||||
shallow_clone = true
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"zlib"
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
# https://llvm.org/docs/CMake.html
|
||||
case "${TARGET}" in
|
||||
x86-unknown-redox)
|
||||
LLVM_TARGETS_TO_BUILD="X86"
|
||||
;;
|
||||
x86_64-unknown-redox)
|
||||
LLVM_TARGETS_TO_BUILD="X86"
|
||||
;;
|
||||
aarch64-unknown-redox)
|
||||
LLVM_TARGETS_TO_BUILD="AArch64"
|
||||
;;
|
||||
riscv64gc-unknown-redox)
|
||||
LLVM_TARGETS_TO_BUILD="RISCV"
|
||||
;;
|
||||
*)
|
||||
LLVM_TARGETS_TO_BUILD="host"
|
||||
;;
|
||||
esac
|
||||
|
||||
COOKBOOK_CMAKE_FLAGS+=(
|
||||
-DCMAKE_CXX_FLAGS="--std=gnu++11"
|
||||
-DBUILD_SHARED_LIBS=False
|
||||
-DLLVM_LINK_LLVM_DYLIB=On
|
||||
-DCROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_TOOLCHAIN_FILE=$(realpath "${COOKBOOK_RECIPE}/native.cmake")"
|
||||
-DLLVM_BUILD_BENCHMARKS=Off
|
||||
-DLLVM_BUILD_EXAMPLES=Off
|
||||
-DLLVM_BUILD_TESTS=Off
|
||||
-DLLVM_BUILD_UTILS=Off
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE="${TARGET}"
|
||||
-DLLVM_ENABLE_LTO=Off
|
||||
-DLLVM_ENABLE_RTTI=On
|
||||
-DLLVM_ENABLE_THREADS=On
|
||||
-DLLVM_ENABLE_ZSTD=Off
|
||||
-DLLVM_INCLUDE_BENCHMARKS=Off
|
||||
-DLLVM_INCLUDE_EXAMPLES=Off
|
||||
-DLLVM_INCLUDE_TESTS=Off
|
||||
-DLLVM_INCLUDE_UTILS=Off
|
||||
-DLLVM_OPTIMIZED_TABLEGEN=On
|
||||
-DLLVM_TARGET_ARCH="$(echo "${TARGET}" | cut -d - -f1)"
|
||||
-DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS_TO_BUILD}"
|
||||
-DLLVM_TOOL_LLVM_COV_BUILD=Off
|
||||
-DLLVM_TOOL_LLVM_LTO_BUILD=Off
|
||||
-DLLVM_TOOL_LLVM_LTO2_BUILD=Off
|
||||
-DLLVM_TOOL_LLVM_PROFDATA_BUILD=Off
|
||||
-DLLVM_TOOL_LLVM_RTDYLD_BUILD=Off
|
||||
-DLLVM_TOOL_LLVM_XRAY_BUILD=Off
|
||||
-DLLVM_TOOL_LLI_BUILD=Off
|
||||
-DLLVM_TOOL_LTO_BUILD=Off
|
||||
-DLLVM_TOOLS_INSTALL_DIR=bin
|
||||
-DLLVM_UTILS_INSTALL_DIR=bin
|
||||
-DUNIX=1
|
||||
-DLLVM_ENABLE_PROJECTS="llvm"
|
||||
)
|
||||
|
||||
cookbook_cmake "${COOKBOOK_SOURCE}/llvm"
|
||||
"""
|
||||
16
recipes/dev/lua54/recipe.toml
Normal file
16
recipes/dev/lua54/recipe.toml
Normal file
@ -0,0 +1,16 @@
|
||||
[source]
|
||||
tar = "https://lua.org/ftp/lua-5.4.7.tar.gz"
|
||||
blake3 = "e51c2f347e3185479d5ff95cae8ac77511db486853269443c56bedaa0a6ae629"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
|
||||
"${COOKBOOK_MAKE}" -j"${COOKBOOK_MAKE_JOBS}" posix \
|
||||
AR="${TARGET}-ar rcu" \
|
||||
CC="${CC_WRAPPER} ${TARGET}-gcc -std=gnu99" \
|
||||
RANLIB="${TARGET}-ranlib" \
|
||||
SYSLDFLAGS="-static"
|
||||
|
||||
"${COOKBOOK_MAKE}" install INSTALL_TOP="${COOKBOOK_STAGE}"
|
||||
"""
|
||||
16
recipes/dev/luajit/recipe.toml
Normal file
16
recipes/dev/luajit/recipe.toml
Normal file
@ -0,0 +1,16 @@
|
||||
[source]
|
||||
git = "https://luajit.org/git/luajit.git"
|
||||
rev = "a4f56a459a588ae768801074b46ba0adcfb49eb1"
|
||||
patches = ["redox.patch"]
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
|
||||
|
||||
${COOKBOOK_MAKE} -j ${COOKBOOK_MAKE_JOBS} install \
|
||||
PREFIX="${COOKBOOK_STAGE}" \
|
||||
TARGET_SYS='Redox' \
|
||||
CROSS="${TARGET}-"
|
||||
"""
|
||||
31
recipes/dev/luajit/redox.patch
Normal file
31
recipes/dev/luajit/redox.patch
Normal file
@ -0,0 +1,31 @@
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 3a6a4329..450e8fe6 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -351,6 +351,9 @@ else
|
||||
ifeq (GNU/kFreeBSD,$(TARGET_SYS))
|
||||
TARGET_XLIBS+= -ldl
|
||||
endif
|
||||
+ ifeq (Redox,$(TARGET_SYS))
|
||||
+ TARGET_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_POSIX
|
||||
+ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -367,12 +370,16 @@ ifneq ($(HOST_SYS),$(TARGET_SYS))
|
||||
else
|
||||
ifeq (iOS,$(TARGET_SYS))
|
||||
HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX -DTARGET_OS_IPHONE=1
|
||||
+ else
|
||||
+ ifeq (Redox,$(TARGET_SYS))
|
||||
+ HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_POSIX
|
||||
else
|
||||
HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OTHER
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
+ endif
|
||||
endif
|
||||
|
||||
ifneq (,$(CCDEBUG))
|
||||
18
recipes/dev/luarocks/recipe.toml
Normal file
18
recipes/dev/luarocks/recipe.toml
Normal file
@ -0,0 +1,18 @@
|
||||
[source]
|
||||
git = "https://github.com/luarocks/luarocks.git"
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"lua54"
|
||||
]
|
||||
script = """
|
||||
|
||||
COOKBOOK_CONFIGURE_FLAGS=(
|
||||
--sysconfdir=$COOKBOOK_SYSROOT
|
||||
--with-lua-include=$COOKBOOK_SYSROOT/include
|
||||
--with-lua-bin=$COOKBOOK_SYSROOT/bin
|
||||
--with-lua-lib=$COOKBOOK_SYSROOT/lib
|
||||
)
|
||||
cd "${COOKBOOK_SOURCE}"
|
||||
cookbook_configure
|
||||
"""
|
||||
7
recipes/dev/nasm/recipe.toml
Normal file
7
recipes/dev/nasm/recipe.toml
Normal file
@ -0,0 +1,7 @@
|
||||
[source]
|
||||
#TODO: nasm.us is down: tar = "https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz"
|
||||
tar = "https://gstreamer.freedesktop.org/src/mirror/nasm-2.14.02.tar.xz"
|
||||
blake3 = "f66c0cc852c3b9e3321f57c33ef336e17a128bd3d854ee095aae7e6f64629f20"
|
||||
|
||||
[build]
|
||||
template = "configure"
|
||||
35
recipes/dev/patch/01_no_rlimit.patch
Normal file
35
recipes/dev/patch/01_no_rlimit.patch
Normal file
@ -0,0 +1,35 @@
|
||||
diff -ru source/lib/getdtablesize.c source-new/lib/getdtablesize.c
|
||||
--- source/lib/getdtablesize.c 2015-03-06 16:31:45.000000000 -0800
|
||||
+++ source-new/lib/getdtablesize.c 2017-08-08 19:33:33.993874985 -0700
|
||||
@@ -106,15 +106,6 @@
|
||||
int
|
||||
getdtablesize (void)
|
||||
{
|
||||
- struct rlimit lim;
|
||||
-
|
||||
- if (getrlimit (RLIMIT_NOFILE, &lim) == 0
|
||||
- && 0 <= lim.rlim_cur && lim.rlim_cur <= INT_MAX
|
||||
- && lim.rlim_cur != RLIM_INFINITY
|
||||
- && lim.rlim_cur != RLIM_SAVED_CUR
|
||||
- && lim.rlim_cur != RLIM_SAVED_MAX)
|
||||
- return lim.rlim_cur;
|
||||
-
|
||||
return INT_MAX;
|
||||
}
|
||||
|
||||
Only in source-new/lib: getdtablesize.c.orig
|
||||
diff -ru source/src/safe.c source-new/src/safe.c
|
||||
--- source/src/safe.c 2015-03-06 16:34:20.000000000 -0800
|
||||
+++ source-new/src/safe.c 2017-08-08 19:33:53.447430811 -0700
|
||||
@@ -92,11 +92,7 @@
|
||||
|
||||
static void init_dirfd_cache (void)
|
||||
{
|
||||
- struct rlimit nofile;
|
||||
-
|
||||
max_cached_fds = 8;
|
||||
- if (getrlimit (RLIMIT_NOFILE, &nofile) == 0)
|
||||
- max_cached_fds = MAX (nofile.rlim_cur / 4, max_cached_fds);
|
||||
|
||||
cached_dirfds = hash_initialize (max_cached_fds,
|
||||
NULL,
|
||||
19
recipes/dev/patch/02_no_chown.patch
Normal file
19
recipes/dev/patch/02_no_chown.patch
Normal file
@ -0,0 +1,19 @@
|
||||
diff -ru source/src/util.c source-new/src/util.c
|
||||
--- source/src/util.c 2015-03-06 16:34:20.000000000 -0800
|
||||
+++ source-new/src/util.c 2017-08-11 18:24:56.991729200 -0700
|
||||
@@ -271,6 +271,7 @@
|
||||
|
||||
/* May fail if we are not privileged to set the file owner, or we are
|
||||
not in group instat.st_gid. Ignore those errors. */
|
||||
+ /*
|
||||
if ((uid != -1 || gid != -1)
|
||||
&& safe_lchown (to, uid, gid) != 0
|
||||
&& (errno != EPERM
|
||||
@@ -281,6 +282,7 @@
|
||||
(uid == -1) ? "owner" : "owning group",
|
||||
S_ISLNK (mode) ? "symbolic link" : "file",
|
||||
quotearg (to));
|
||||
+ */
|
||||
}
|
||||
if (attr & FA_XATTRS)
|
||||
if (copy_attr (from, to) != 0
|
||||
15
recipes/dev/patch/03_renameat2.patch
Normal file
15
recipes/dev/patch/03_renameat2.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- source-old/lib/renameat2.c 2018-02-03 05:41:53.000000000 -0700
|
||||
+++ source/lib/renameat2.c 2025-11-01 08:39:54.945513820 -0600
|
||||
@@ -70,6 +70,7 @@
|
||||
Obey FLAGS when doing the renaming. If FLAGS is zero, this
|
||||
function is equivalent to renameat (FD1, SRC, FD2, DST). */
|
||||
|
||||
+#if !defined(__redox__)
|
||||
int
|
||||
renameat2 (int fd1, char const *src, int fd2, char const *dst,
|
||||
unsigned int flags)
|
||||
@@ -225,3 +226,4 @@
|
||||
|
||||
#endif /* !HAVE_RENAMEAT */
|
||||
}
|
||||
+#endif
|
||||
28
recipes/dev/patch/recipe.toml
Normal file
28
recipes/dev/patch/recipe.toml
Normal file
@ -0,0 +1,28 @@
|
||||
[source]
|
||||
tar = "https://ftp.gnu.org/gnu/patch/patch-2.7.6.tar.xz"
|
||||
blake3 = "d46d14c12aa4ea51e356bf92091c368fd871e1d770b94bc29027886737aecd5f"
|
||||
patches = [
|
||||
"01_no_rlimit.patch",
|
||||
"02_no_chown.patch",
|
||||
"03_renameat2.patch",
|
||||
]
|
||||
script = """
|
||||
wget -O build-aux/config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false"
|
||||
autoreconf
|
||||
"""
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
COOKBOOK_CONFIGURE="${COOKBOOK_SOURCE}/configure"
|
||||
COOKBOOK_CONFIGURE_FLAGS=(
|
||||
--host="${TARGET}"
|
||||
--prefix="/"
|
||||
--build="$(gcc -dumpmachine)"
|
||||
)
|
||||
|
||||
cookbook_configure
|
||||
|
||||
${TARGET}-strip "${COOKBOOK_STAGE}/bin/"*
|
||||
rm -rf "${COOKBOOK_STAGE}/share" "${COOKBOOK_STAGE}/lib"
|
||||
"""
|
||||
9
recipes/dev/pciids/recipe.toml
Normal file
9
recipes/dev/pciids/recipe.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://github.com/pciutils/pciids.git"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
install -d "${COOKBOOK_STAGE}/share/misc/"
|
||||
install "${COOKBOOK_SOURCE}"/pci.ids "${COOKBOOK_STAGE}/share/misc/"
|
||||
"""
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user