Skip to content

Instantly share code, notes, and snippets.

@demotomohiro
Created October 10, 2020 01:24
Show Gist options
  • Save demotomohiro/c8959fa5d77987f7d94fa1672d62f5b6 to your computer and use it in GitHub Desktop.
Save demotomohiro/c8959fa5d77987f7d94fa1672d62f5b6 to your computer and use it in GitHub Desktop.
Build & Install libnice 0.1.17 on gentoo linux
import os
proc execQuote(args: varargs[string]) =
args.quoteShellCommand.exec
proc download(url, dist: string) =
mkDir dist.parentDir
execQuote "wget", url, "-O", dist
proc untar(src, dist: string) =
when hostOS == "windows":
execQuote "tar", "--force-local", "--no-same-owner", "-x", "-C", dist, "-f", src
else:
execQuote "tar", "x", "-C", dist, "-f", src
proc unzip(src, dist: string) =
execQuote "unzip", src, "-d", dist
template downloadAnd(un: proc; url, tmp, dist: string) =
download(url, tmp)
un(tmp, dist)
proc main =
let
downloadDir = nimcacheDir() / projectName()
rootDir = "/tmp/tmp"
installDir = rootDir / "install"
buildDir = rootDir / "libnice_build"
mkDir rootDir
downloadAnd untar,
"https://libnice.freedesktop.org/releases/libnice-0.1.17.tar.gz",
downloadDir / "libnice.tar.gz",
rootDir
execQuote "meson", "--prefix", installDir, buildDir, rootDir / "libnice-0.1.17"
execQuote "meson", "compile", "-C", buildDir
execQuote "meson", "install", "-C", buildDir
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment