How to use HaxeFlixel together with openfl-bitfive - html

I would like to build a HaxeFlixel project against a HTML5 target, using openfl-bitfive
In the Readme for openfl-bitfive:
https://github.com/YellowAfterlife/openfl-bitfive#usage, it says:
"Navigate to application.xml of your project and add the following
before inclusion of OpenFL library: <set name="html5-backend" value="openfl-bitfive" />"
In HaxeFlixel, there is no application.xml, and the closest thing to
it is Project.xml.
So I put in "<set name="html5-backend" value="openfl-bitfive" />" as
the first child node of the "<project>" element.
I then run the build command, and get the following error output:
$ lime build html5
/usr/lib/haxe/lib/openfl-bitfive/2,0,1/openfl/Assets.hx:487:
characters 31-57 : DefaultAssetLibrary should be openfl.AssetLibrary
/usr/lib/haxe/lib/openfl-bitfive/2,0,1/openfl/Assets.hx:487:
characters 31-57 : For function argument 'library'
/usr/lib/haxe/lib/lime/2,0,0-alpha,7/lime/system/System.hx:75:
characters 2-35 : Class<ApplicationMain> has no field config
/usr/lib/haxe/lib/lime/2,0,0-alpha,7/lime/system/System.hx:76:
characters 2-32 : Class<ApplicationMain> has no field config
/usr/lib/haxe/lib/lime/2,0,0-alpha,7/lime/system/System.hx:77:
characters 2-24 : Class<ApplicationMain> has no field create
As you can see, the openfl-bitfive library gets invoked, however,
something goes wrong, and I do not understand the error messages.
What is going wrong here?
Anyone out there who has successfully used openfl-bitfive to compile a HaxeFlixel project, please let me know how!
Libraries and versions:
$ haxelib list
flixel-addons: [1.1.0]
flixel-demos: [1.1.1]
flixel-templates: [1.0.2]
flixel-tools: [1.0.2]
flixel-ui: [1.0.2]
flixel: [3.3.5]
hxcpp: [3.1.39]
lime: [2.0.0-alpha.7]
openfl-bitfive: [2.0.1]
openfl: [2.1.5]

You don't need to set the HTML5 backend actually, it's flixel's default backend already.
However, bitfive is not yet compatible with the most recent OpenFL / Lime versions.
There are two options:
use OpenFL's default HTML5 backend via <set name="no-custom-backend" />
downgrade to openfl 2.0.1 / lime 1.0.1 / lime-tools 1.5.7

Unfortunately, openfl-bitfive: [2.0.1] is incompatible with lime: [2.0.0-alpha.7] and openfl: [2.1.5]. You need to switch back to openfl [2.0.1] for compiling with openfl-bitfive: [2.0.1].

Related

Having trouble compiling scribble document with `#lang scribble/html`

I'm trying to use Scribble (Racket v8.0 [cs]) to generate some HTML using #lang scribble/html and I've reduced my source file to only the lang statement (to isolate other issues):
#lang scribble/html
To run the code I'm using terminal:
% scribble test.scrbl
However, I'm running into the following error during compilation:
dynamic-require: name is not provided
name: 'doc
module: #<resolved-module-path:"/Users/josh/Desktop/blog architecture/00001 article name/test.scrbl">
context...:
.../private/map.rkt:40:19: loop
.../racket/cmdline.rkt:191:51
body of "/Applications/Racket v8.0/share/pkgs/scribble-lib/scribble/run.rkt"
Obviously something is missing - perhaps a require statement? I'm not sure. If you have a better approach to using #lang scribble/html I'm open to that as long as I can use the html tags.
Thank you!
Hello person from 6 months ago! I hope you have solved your problem, but for other travelers here's what worked for me:
Don't use the scribble binary, but directly use the racket executable.
So, instead of:
$ scribble test.scrbl
Do
$ racket test.scrbl
This seemed to work for me with scribble/text, and outputted exactly what I wanted (nothing weirdly processed, nothing "helpfully" escaped - just my text + my racket code executed)

Setting Jenkins build name from package.json version value

I want to include the value of the "version" parameter in package.json as part of the Jenkins build name.
I'm using the Jenkins Build Name Setter plugin - https://wiki.jenkins-ci.org/display/JENKINS/Build+Name+Setter+Plugin
So far I've tried to use PROPFILE syntax in the "Build name macro template" step:
${PROPFILE,file="./mainline/projectDirectory/package.json",property="\"version\""}
This successfully creates a build, but includes the quotes and comma surrounding the value of the version property in package.json, for example:
"0.0.1",
I want just the value inside returned, so it reads
0.0.1
How can I do this? Is there a different plugin that would work better for parsing package.json and getting it into the template, or should I resort to some sort of regex for removing the characters I don't want?
UPDATE:
I tried using token transforms based on reading the Token Macro Plugin documentation, but it's not working:
${PROPFILE%\"\,#\",file="./mainline/projectDirectory/package.json",property="\"version\""}
still just returns
However, using only one escaped character and only one of # or % works. No other combinations I tried work.
${PROPFILE%\,,file="./mainline/projectDirectory/package.json",property="\"version\""}
which returns "0.0.1" (comma removed)
${PROPFILE#\"%\"\,,file="./mainline/projectDirectory/package.json",property="\"version\""}
which returns "0.0.1", (no characters removed)
UPDATE:
Tried to use the new Jenkins Token Macro plugin's JSON macro with no luck.
Jenkins Build Name Setter set to update the build name with Macro:
${JSON,file="./mainline/pathToFiles/package.json",path="version"}-${P4_CHANGELIST}
Jenkins build logs for this job show:
10:57:55 Evaluated macro: 'Error processing tokens: Error while parsing action 'Text/ZeroOrMore/FirstOf/Token/DelimitedToken/DelimitedToken_Action3' at input position (line 1, pos 74):
10:57:55 ${JSON,file="./mainline/pathToFiles/package.json",path="version"}-334319
10:57:55 ^
10:57:55
10:57:55 java.io.IOException: Unable to serialize org.jenkinsci.plugins.tokenmacro.impl.JsonFileMacro$ReadJSON#2707de37'
I implemented a new macro JSON, which takes a file and a path (which is the key hierarchy in the JSON for the value you want) in token-macro-2.1. You can only use a single transform per macro usage.
Try the token transformations # and % (see Token-Makro-Plugin):
${PROPFILE#"%",file="./mainline/projectDirectory/package.json",property="\"version\""}
(This will only help if you are using pipelines. But for what it's worth,..)
What works for me is a combination of readJSON from the Pipeline Utility Steps plugin and directly setting currentBuild.displayName, thusly:
script {
// readJSON from "Pipeline Utility Steps"
def packageJson = readJSON file: 'package.json'
def version = packageJson.version
echo "Setting build version: ${packageJson.version}"
currentBuild.displayName = env.BUILD_NUMBER + " - " + packageJson.version
// currentBuild.description = "other cool stuff"
}
Omitting error handling etc obvs.

Using mxmlc to compile as files with more than one src paths

I am using mxmlc.exe to compile my Flash project but I have two separated source files.
I noticed that I can specify more than one -compiler.library-path but it seems not OK to specify more than one -compiler.source-path parameters.
For some reasons I have to keep the src files in different folders. Is there any way I can still compile?
Thanks!
The desired command-line parameters:
mxmlc.exe src/Editor.as
-output=Editor.swf
-compiler.source-path=src1 -compiler.source-path=../src2
-compiler.library-path=libs -compiler.library-path=../libs
The += operator will append the second path to compiler.library-path, whereas the = operator will replace the value with a new one.
try this instead:
mxmlc.exe src/Editor.as
-output=Editor.swf
-compiler.source-path=src1 -compiler.source-path=../src2
-compiler.library-path+=libs -compiler.library-path=../libs
You might have to play a bit with the spacing before and after the += to get it working exactly right.

dpkg-shlibdeps: error: no dependency information found for

I'm compiling a deb package and when I run dpkg-buildpackage I get:
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libopencv_highgui.so.2.3
...
make: *** [binary-arch] Error 2
This happens because I installed the dependency manually. I know that the problem will be fixed if I install the dependency (or use checkinstall), and I want to generate the package anyway because I'm not interested on dependency checking. I know that I can give to dpkg-shlibdeps the option --ignore-missing-info which prevents a fail if dependency information can't be found. But I don't know how to pass this option to dpkg-shlibdeps since I'm using dpkg-buildpackage and dpkg-buildpackage calls dpkg-shlibdeps...
I have already tried:
sudo dpkg-buildpackage -rfakeroot -d -B
And with:
export DEB_DH_MAKESHLIBS_ARG=--ignore-missing-info
as root.
Any ideas?
use:
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
if your rule file hasn't the dh_shlibdeps call in it. That's usually the case if you've
%:
dh $#
as only rule in it ... in above you must use a tab and not spaces in front of the dh_shlibdeps
If you want it to just ignore that flag, change the debian/rules line from:
dh_shlibdeps
to:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
Yet another way, without modifying build scripts, just creating one file.
You can specify local shlib overrides by creating debian/shlibs.local with the following format: library-name soname-version dependencies
For example, given the following (trimmed) ldd /path/to/binary output
libevent-2.0.so.5 => /usr/lib/libevent-2.0.so.5 (0x00007fc9e47aa000)
libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007fc9e4161000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fc9e3b1a000)
The contents of debian/shlibs.local would be:
libevent-2.0 5 libevent-2.0
libgcrypt 20 libgcrypt
libpthread 0 libpthread
The "dependencies" list (third column) doesn't need to be 100% accurate - I just use the library name itself again.
Of course this isn't needed in a sane debian system which has this stuff defined in /var/lib/dpkg/info (which can be used as inspiration for these overrides). Mine isn't a sane debian system.
Instead of merely ignoring the error, you might also want to fix the source of the error, which is usually either a missing or an incorrect package.shlibs or package.symbols file in package which contains the shared library triggering the error.
[1] documents how dpkg-shlibdeps uses the package.shlibs resp. package.symbols, files, [2] documents the format of the package.shlibs and package.symbols files.
[1] https://manpages.debian.org/jessie/dpkg-dev/dpkg-shlibdeps.1.en.html
[2] https://www.debian.org/doc/debian-policy/ch-sharedlibs.html
You've just misspelled your export. It should be like this:
export DEB_DH_SHLIBDEPS_ARGS_ALL=--dpkg-shlibdeps-params=--ignore-missing-info
dpkg-buildpackage uses make to process debian/rules. in this process, dpkg-buildpackage it might call dpkg-shlibdeps.
thus, the proper way to pass modify a part of the package building process is to edit debian/rules.
it's hard to give you any more hints, without seeing the actual debian/rules.
Finally I did it in the brute way:
I edited the script /usr/bin/dpkg-shlibdeps, changing this :
my $ignore_missing_info = 0;
to
my $ignore_missing_info = 1;
You can use this:
dh_makeshlibs -a -n
exactly after dh_install

Problem with conflict between mysql and math.h

The problem is that the compiler says that there is a redefinition of a function between a library that belongs to MySQL and math.h from the std library.
I have been over this for two days and I still can't figure it out.
Has this ever happened to anyone?
This is the output from the compiler
C:\mingw\bin\mingw32-make.exe all
'Building file: ../src/interfaz/ventanaconf.cpp'
'Invoking: GCC C++ Compiler'
C:\mingw\bin\mingw32-g++.exe -mms-bitfields -I"c:\dev-cpp\gtkmm\include\gtkmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\gtkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\glibmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\glibmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\gdkmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\gdkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\pangomm-1.4"
-I"c:\dev-cpp\gtkmm\include\atkmm-1.6" -I"c:\dev-cpp\gtkmm\include\sigc++-2.0"
-I"c:\dev-cpp\gtkmm\lib\sigc++-2.0\include" -I"c:\dev-cpp\gtkmm\include\cairomm-1.0"
-I"c:\gtk\include\gtk-2.0"
-I"c:\gtk\include\glib-2.0"
-I"c:\gtk\lib\glib-2.0\include"
-I"c:\gtk\lib\gtk-2.0\include"
-I"c:\gtk\include\pango-1.0"
-I"c:\gtk\include\cairo"
-I"c:\gtk\include\freetype2"
-I"c:\gtk\include"
-I"c:\gtk\include\atk-1.0"
-I"c:\Archivos de programa\MySQL\MySQL Server 5.0\include"
-O0 -g3 -w -c -fmessage-length=0 -MMD -MP -MF"src/interfaz/ventanaconf.d"
-MT"src/interfaz/ventanaconf.d"
-o"src/interfaz/ventanaconf.o" "../src/interfaz/ventanaconf.cpp"
In file included from c:/Archivos de programa/MySQL/MySQL Server 5.0/include/my_global.h:73,
from ../src/interfaz/../gestiondb/gestordb.h:6,
from ../src/interfaz/../gestiondb/operacionesdb.h:5,
from ../src/interfaz/ventanamodulos.h:20,
from ../src/interfaz/ventanaconf.h:27,
from ../src/interfaz/ventanaconf.cpp:1:
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h: **In function `double rint(double)':
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h:228: error: redefinition of `double rint(double)'
C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h:620: **error: `double rint(double)' previously defined here**
C:\mingw\bin\mingw32-make.exe: *** [src/interfaz/ventanaconf.o] Error 1**
Thanks in advance!!!
This thread in the mysql support area seems to indicate that they've taken the definition of rint() out of their config_win.h file as of April this year (even though the patch was proposed in 2006). Are you using a version of the MySQL source newer than that?
The problem was about an included library, which linux simply ignores, but windows want out. There is no problem letting it out in linux neither...
Somedays i feel SOOOOOOOOOOOOOOOOOOOOOOO STUPID:..
In line 228 of c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h you should find a declaration/definition of function named "rint". In line 620 of C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h you should find another definition of a function with the same name (which probably even does the same).
To solve the problem you will have to delete/outcomment/undefine one of these definitions.
Be prepared to get a similar problem when linking, if you also link two libraries with the same function.