Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve build #402

Merged
merged 11 commits into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 124 additions & 104 deletions data/ui/options.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>696</width>
<height>653</height>
<width>727</width>
<height>749</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -21,7 +21,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>4</number>
</property>
<widget class="QWidget" name="tabGeneration">
<attribute name="title">
Expand All @@ -33,7 +33,7 @@
<x>20</x>
<y>20</y>
<width>314</width>
<height>90</height>
<height>99</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
Expand Down Expand Up @@ -217,8 +217,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>644</width>
<height>316</height>
<width>647</width>
<height>380</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4"/>
Expand Down Expand Up @@ -429,51 +429,74 @@
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Default sending repititions:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBoxNumSendingRepeats">
<property name="specialValueText">
<string>Infinite</string>
</property>
<property name="showGroupSeparator" stdset="0">
<bool>false</bool>
</property>
<property name="maximum">
<number>999999999</number>
</property>
<property name="displayIntegerBase">
<number>10</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Use this percentage of available RAM for buffer allocation:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxRAMThreshold">
<property name="suffix">
<string>%</string>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
</widget>
</item>
</layout>
<widget class="QGroupBox" name="groupBoxNativeOptions">
<property name="title">
<string>Native options</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="3" column="2">
<widget class="QLabel" name="labelRebuildNativeStatus">
<property name="text">
<string>Rebuild &lt;x&gt; new device extensions. Please restart URH to use them.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelLibDirs">
<property name="text">
<string>Library directories:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="btnRebuildNative">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Rebuild the native device extensions. You need to restart URH after this, to use new extensions.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Rebuild</string>
</property>
<property name="icon">
<iconset theme="view-refresh">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="labelNativeRebuildInfo">
<property name="text">
<string>You can rebuild the native device extensions here. This is useful, when you installed a device driver afterwards or your drivers are stored in an unusual location.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="lineEditLibDirs">
<property name="placeholderText">
<string>Comma separated list of additional library directories</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="btnViewBuildLog">
<property name="text">
<string>View log</string>
</property>
<property name="icon">
<iconset theme="utilities-log-viewer"/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
Expand Down Expand Up @@ -571,62 +594,59 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxNativeOptions">
<property name="title">
<string>Native options</string>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="2" column="0">
<widget class="QLabel" name="labelLibDirs">
<property name="text">
<string>Library directories:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="btnRebuildNative">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Rebuild the native device extensions. You need to restart URH after this, to use new extensions.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Rebuild</string>
</property>
<property name="icon">
<iconset theme="view-refresh">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="labelNativeRebuildInfo">
<property name="text">
<string>You can rebuild the native device extensions here. This is useful, when you installed a device driver afterwards or your drivers are stored in an unusual location.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="lineEditLibDirs">
<property name="placeholderText">
<string>Comma separated list of additional library directories</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="labelRebuildNativeStatus">
<property name="text">
<string>Rebuild &lt;x&gt; new device extensions. Please restart URH to use them.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Default sending repititions:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBoxNumSendingRepeats">
<property name="specialValueText">
<string>Infinite</string>
</property>
<property name="showGroupSeparator" stdset="0">
<bool>false</bool>
</property>
<property name="maximum">
<number>999999999</number>
</property>
<property name="displayIntegerBase">
<number>10</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Use this percentage of available RAM for buffer allocation:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxRAMThreshold">
<property name="suffix">
<string>%</string>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
Expand Down
19 changes: 9 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,20 @@ def get_package_data():
return package_data


def get_ext_modules():
def get_extensions():
filenames = [os.path.splitext(f)[0] for f in os.listdir("src/urh/cythonext") if f.endswith(EXT)]

extensions = [Extension("urh.cythonext." + f, ["src/urh/cythonext/" + f + EXT],
extra_compile_args=[OPEN_MP_FLAG],
extra_link_args=[OPEN_MP_FLAG],
language="c++") for f in filenames]

ExtensionHelper.USE_RELATIVE_PATHS = True
extensions += ExtensionHelper.get_device_extensions(USE_CYTHON)

if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions, compiler_directives=COMPILER_DIRECTIVES, quiet=True)

return extensions


Expand Down Expand Up @@ -128,13 +134,6 @@ def read_long_description():
if sys.version_info < (3, 4):
install_requires.append('enum34')

ExtensionHelper.USE_RELATIVE_PATHS = True
extensions = get_ext_modules() + ExtensionHelper.get_device_extensions(USE_CYTHON)

if USE_CYTHON:
from Cython.Build import cythonize

extensions = cythonize(extensions, compiler_directives=COMPILER_DIRECTIVES)

setup(
name="urh",
Expand All @@ -151,7 +150,7 @@ def read_long_description():
install_requires=install_requires,
setup_requires=['numpy'],
packages=get_packages(),
ext_modules=extensions,
ext_modules=get_extensions(),
cmdclass={'build_ext': build_ext},
zip_safe=False,
entry_points={
Expand Down
Empty file removed src/__init__.py
Empty file.
Loading