how to add libxml2 as dependency to SwiftPM - libxml2

I want to update one library to use Swift Package Manager. Currently, it based on Carthage/Pods. But it uses libxml2 (#import ) as dependency. I have tried to add spm support but got an error this framework could not be found -> libxml/xmlreader.h
I also found some thread https://forums.swift.org/t/referring-to-libxml2-in-swift-package-description/28880/5
but seems still there is no solution. Would be great if someone can help.

I'm happy to say that this issue has now been fixed as of Xcode 11. All you need to do is import libxml2 just as you would any other module from the SDK such as Foundation or UIKit -- no additional search paths or configuration are needed.
For C targets you can also change the import style from #import <libxml2/libxml/.h> to just #import <libxml/.h> for compatibility with the more common header layout on Linux.

Related

Dependency conflicts, while installing qt via conan

I have a problem with installing and using qt via conan.
The actual error looks like below:
WARN: glib/2.58.3#bincrafters/stable: requirement zlib/1.2.11 overridden by qt/5.13.0#bincrafters/stable to zlib/1.2.11#conan/stable
WARN: pcre/8.41: requirement zlib/1.2.11 overridden by glib/2.58.3#bincrafters/stable to zlib/1.2.11#conan/stable
ERROR: Conflict in pcre/8.41
Requirement bzip2/1.0.8 conflicts with already defined bzip2/1.0.8#conan/stable
To change it, override it in your base requirements
My conanfile.txt:
[requires]
gtest/1.8.1#bincrafters/stable
boost/1.70.0#conan/stable
jsonformoderncpp/3.7.0#vthiery/stable
qt/5.13.0#bincrafters/stable
[generators]
cmake
[options]
qt:with_mysql=False
I managed to resolve this dependency by adding bzip2/1.0.8#conan/stable to [requires] section, but than my application is missing fonts, that are mandatory:
QFontDatabase: Cannot find font directory /home/<user>/.conan/data/qt/5.13.0/bincrafters/stable/package/82f32da7b204a38af07f00f05f94ebbfd7454b77/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.
This fonts directory is actually missing. Please note, that this project builds and run without such problems on other coworkers, same machines.
The question is - what causes those problems and how to resolve them?
The dependencies conflict should be solved by switching to qt/5.13.1#bincrafters/stable, because a lot of dependencies have migrated to conan center.
Regarding the fonts issue, I'm in the process of adding an optional dependancy on fontconfig/2.13.1#conan/stable in the qt recipe. In the meantime, you could try to install system version of fontconfig, rebuild the qt recipe, and check the output to see if has "Fontconfig ............................. yes"

File to import not found or unreadable: bootstrap-sass

Trying out Django Shop. Following this tutorial: https://django-shop.readthedocs.io/en/stable/tutorial/intro.html (stable).
When I run the server and open localhost, here's what I see:
Error: File to import not found or unreadable: bootstrap-sass/assets/stylesheets/bootstrap/variables.
Parent style sheet: /home/vm/PycharmProjects/Django-shop/django-shop/shop/static/shop/css/_variables.scss
on line 1 of ../shop/static/shop/css/_variables.scss
>> #import "bootstrap-sass/assets/stylesheets/bootstrap/variables";
I presume, this "bootstrap-sass" directory is supposed to be in "css" and I don't see it there.
Only happens on front of the website. I can open admin panel just fine.
The error mentioned in the comment that says No module named 'django.core.urlresolvers' gives you a clue that there is a django compatibility issue. To understand more about this error please refer to this answer on Stackoverflow, which discusses a particular changelog from Django 1.x version to 2.x.
Now that we know that this could be a point of conflict here, refer to Compatibility Table, which clearly states that Django Shop is not compatible with Django 2.x versions as of now and in your project setup when you pip install django, it installs the latest version of django which is 2.1. Therefore to overcome this, you should downgrade the Django to a version thats compatible with your Django Shop version. So a working combination would be Django 1.11 and Django Shop 0.13.x.

Why does css get installed when I run npm install [someLibraryName]?

When I run this command...
npm install vue-material
It seemed to install and override some css in my application causing css conflicts. I had to search and find the exact piece of css and override it directly on the specific vue component's section.
Is there anyway to prevent this from happening when installnig NPM packages?
Technologies uses:
vue.js
webpack
material-vue
I believe I found out what I was looking for thank you #ljubadr for your help.
In the recommended Getting Started vue material guide it states you can:
import 'vue-material/dist/vue-material.min.css'
However, if you only need one component, this should work for a specific CSS need on a specific vue component:
import 'vue-material/dist/Components/MdCard/index.css'

how to provide tether/anything-else globally in my meteor1.3 typescript project?

I'm hardly trying to get my existing ng2-prototype running in a meteor1.3 setup. So far i was building the prototype with webpack, and there is a provide plugin to make things like jQuery or Tether available during module building:
plugins: [
new ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
"window.Tether": "tether"
})
]
As you can see, i did the same with "tether", since it's still the lib needed by bootstrap 4 alpha.
Now i'm wondering how i could achieve the same in my meteor1.3 project..? As written in the changelogs of the package "angular2-meteor", it is using webpack under the hood now to build everything.
angular2-meteor changelog
So, it should be possible to use the same provide plugin again in meteor1.3, right? But... how?
From the github issue threads of "angular2-meteor":
there are multiple ways: you could install https://atmospherejs.com/coursierprive/tether, or,
since Meteor 1.3 prefers NPM now, you could install Tether NPM and require it before you use bootstrap 4, or, if you want more control and modularity, you could create own local package (in the packages folder) with all dependencies (added from NPMs) you need including Tether (similar to the way angular2-runtime done in this repo).
i will try this out and i'm already sure this will do the trick :) many thx #barbatus ;)
Update:
Ok i'm going with the npm package solution, i had tether installed already. If you don't have it, do this first:
npm install --save tether
Now, the single require statement won't be enough.. bootstrap 4 which i'm trying to include completely is asking for a window.Tether function. So i ended up doing this:
let Tether = require('tether');
window.Tether = Tether;
// import all bootstrap javascript plugins
require('bootstrap');
Cool is, there is also a typings definition file for it now, just add it by running:
typings install --save --ambient tether
After adding it to the window global context, the errors are gone... but ok, the solution trough the webpack provide plugin feels still cleaner -> it will provide the Tether object for each module separately during build, so it won't end up living in the window global context after all. But i'm just lucky to have it running now :)
PS: jQuery is provided anyways by meteor, that's the reason it is already enough to get it running by just including tether alone.
Update: yeah jQuery is included by default - but it is just a package in your /.meteor/packages file ;)

How to find the latest versions of all QML modules

Usually my QML files start with import QtQuick 2.4 and other imports. How can I know which is the latest version of the imported modules without having to guess by type and build?
You basically don't have to know. By importing a particular version, you merely declare that you don't need the additional functionality of any potentially newer version. That doesn't mean that you won't use a newer version if one is available - it simply means that your code will refuse to run if only an older version than the one you need is present.
So, you should only change the imported module version if you happen to use the functionality (members, classes, etc.) from a newer version. That's all. And you will know exactly what version you need, since you're using the functionality you read about in the documentation. The documentation will state what module version it applies to.
The documentation for a given Qt Quick module from the Qt that you're using will state this - no need for release notes.
The QML module version information can be found in a file called plugins.qmltypes.
These files use JSON to store information (as far as I am aware).
In these files Qt uses the "exports" specifier to export the name and version of a module.
Example:
exports: ["QtQuick/Accessible 2.0"]
The example shows the version of the QtQuick.Accessible module.
The plugins.qmltypes are stored in a directory of the same name as base level module.
In the case of the example this would be QtQuick.
Base level modules are grouped under a directory titled qml.
That is "usually" located in a directory called qtx (in some case Qt).
Where x is the installed major version of Qt (in my case it would be qt5).
That means the plugins.qmltypes has a path that looks something like this:
/qt5/qml/QtQuick/plugins.qmltypes
The reason im explaining this bottoms up cause the rest of the path is dependent on how you installed Qt:
Package manager (portage) amd64 install path:
/usr/lib64/qt5/qml/
pip PySide6 install path:
~/.local/lib/python3.9/site-packages/PySide6/Qt/qml/
pip PyQt6 install path:
~/.local/lib/python3.9/site-packages/PyQt6/Qt6/qml
~/.local/lib/python3.9/site-packages/PyQt6/Qt6/qml
Package manager (apt) aarch64 install path:
/usr/lib64/aarch64-{forgot this part}-/qt5/qml/
I figure the version out in bulk with:
grep -r "exports:.*\\]" <insert install/OS dependent path>/qml/* | less
This doesnt grab multiple exports that are spread over multiple lines thought.
Since QML comes in 2 major versions when in doubt you could import version 1.0 or 2.0.

Resources