-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/conan' into develop
- Loading branch information
Showing
7 changed files
with
105 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from conans import ConanFile, tools | ||
|
||
class RNBORunnerPanelConan(ConanFile): | ||
name = "rnborunnerpanel" | ||
description = "Packaged build outputs from rnbo-runner-panel" | ||
author = "Cycling'74" | ||
url = "https://github.com/Cycling74/rnbo-runner-panel" | ||
settings = None | ||
license = "MIT" | ||
no_copy_source = True | ||
|
||
def export_sources(self): | ||
self.copy("bin/**", src="build/usr/") | ||
self.copy("share/**", src="build/usr/") | ||
|
||
def build(self): | ||
#do nothing | ||
return | ||
|
||
def package(self): | ||
self.copy("*") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { execSync } from "child_process"; | ||
import { readPkgInfoVersion } from "./utils.mjs"; | ||
import { dirname, join, resolve } from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
const basedir = resolve(dirname(fileURLToPath(import.meta.url)), ".."); | ||
const version = process.env.PKG_VERSION || readPkgInfoVersion(join(basedir, "package.json")); | ||
const tag = "c74/testing"; | ||
|
||
execSync(`conan create . ${version}@${tag}`); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { dirname, join, resolve } from "path"; | ||
import fs from "fs-extra"; | ||
import { fileURLToPath } from "url"; | ||
import { execSync } from "child_process"; | ||
import { readPkgInfoVersion } from "./utils.mjs"; | ||
|
||
const { readFileSync, writeFileSync, rmSync, copySync } = fs; | ||
|
||
const debian = process.argv.includes("--debian"); | ||
const outdir = process.argv.at(-1); | ||
|
||
const basedir = resolve(dirname(fileURLToPath(import.meta.url)), ".."); | ||
const name = process.env.PKG_NAME || "rnbo-runner-panel"; | ||
|
||
// cleanup if we have an existing export | ||
rmSync(join(outdir, "usr"), { recursive: true, force: true }); | ||
|
||
copySync(join(basedir, "out"), join(outdir, "usr", "share", name, "www"), { overwrite: true } ); | ||
copySync(join(basedir, "server.py"), join(outdir, "usr", "bin", name), { overwrite: true } ); | ||
|
||
//do debian specific packaging | ||
if (debian) { | ||
const version = process.env.PKG_VERSION || readPkgInfoVersion(join(basedir, "package.json")); | ||
// add the version into the control file | ||
const control = readFileSync(join(outdir, "DEBIAN", "control.in"), "utf8").replace(/[\s\n]*$/, "") + `\nVersion: ${version}\n`; | ||
writeFileSync(join(outdir, "DEBIAN", "control"), control); | ||
|
||
const deb = `${name}_${version}.deb`; | ||
execSync(`dpkg-deb --build . ../${deb}`, { cwd: outdir }); | ||
console.log(`created ${deb}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import fs from "fs-extra"; | ||
const { readFileSync } = fs; | ||
|
||
export const readPkgInfoVersion = fpath => { | ||
const info = JSON.parse(readFileSync(fpath, { encoding: "utf8"} )); | ||
if (!info.version) throw new Error("Missing version property in pacakge.json file"); | ||
return info.version; | ||
}; |